OpenJPA
  1. OpenJPA
  2. OPENJPA-838

fix parameter setting problem when QuerySQLCache is on

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.1, 1.3.0, 2.0.0-M2
    • Component/s: jdbc
    • Labels:
      None

      Description

      java.lang.IndexOutOfBoundsException
      at java.util.ArrayList.get(Unknown Source)
      at org.apache.openjpa.jdbc.sql.SQLBuffer.setParameters(SQLBuffer.java:629)
      at
      org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:529)
      at
      org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:485)
      at
      org.apache.openjpa.jdbc.sql.SelectImpl.prepareStatement(SelectImpl.java:463)
      at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:379)
      at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:339)
      at
      org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:420)
      at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
      at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
      at
      org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategy.load(StoreCollectionFieldStrategy.java:629)
      at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:822)
      at
      org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:682)
      at
      org.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:116)
      at org.apache.openjpa.kernel.ROPStoreManager.load(ROPStoreManager.java:78)
      at
      org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:2924)
      at
      org.apache.openjpa.kernel.StateManagerImpl.load(StateManagerImpl.java:379)
      at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:864)

        Activity

        Hide
        Fay Wang added a comment -

        The problem of parameter setting when cache is on is a result of how OpenJPA processes parameters. There is no distinction between literal vs. user-specified parameters and there is no clear-cut way to separate parameter setting logic from the logic to reconstruct SQLBuffer within SelectImpl, making re-using SQLBuffer within SelectImpl impossible,

        Show
        Fay Wang added a comment - The problem of parameter setting when cache is on is a result of how OpenJPA processes parameters. There is no distinction between literal vs. user-specified parameters and there is no clear-cut way to separate parameter setting logic from the logic to reconstruct SQLBuffer within SelectImpl, making re-using SQLBuffer within SelectImpl impossible,
        Hide
        Fay Wang added a comment -

        change is committed to openjpa 1.2.x r728758, 1.3.x r728753, trunk r728750

        Show
        Fay Wang added a comment - change is committed to openjpa 1.2.x r728758, 1.3.x r728753, trunk r728750
        Hide
        Michael Dick added a comment -

        We need a testcase for this issue to prevent future regressions. I'm reopening the issue and assigning to Fay.

        Show
        Michael Dick added a comment - We need a testcase for this issue to prevent future regressions. I'm reopening the issue and assigning to Fay.
        Hide
        Fay Wang added a comment -

        Test cases are checked in openjpa 1.2.x (r-738137) and openjpa 1.3.x (r-738136). The test case will be checked into the trunk once Jeremy give a green light.

        Show
        Fay Wang added a comment - Test cases are checked in openjpa 1.2.x (r-738137) and openjpa 1.3.x (r-738136). The test case will be checked into the trunk once Jeremy give a green light.
        Hide
        Fay Wang added a comment -

        Test case is checked into trunk r-738918.

        Show
        Fay Wang added a comment - Test case is checked into trunk r-738918.

          People

          • Assignee:
            Fay Wang
            Reporter:
            Fay Wang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development