Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2493

SQLException while processing a query result

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.2, 2.3.0
    • Fix Version/s: None
    • Component/s: kernel, query
    • Labels:
      None

      Description

      I encountered a bug in a test environment that I wanted to open so I don't forget about it.

      My best guess is that this bug is somewhere in one of the query / sql caches. It looks very similar to OPENJPA-2482, but it is indeed different. Attached below is a multithreaded test that is able to recreate the stacktrace below 75% of the time.

      <openjpa-0.0.0-rnull nonfatal general error> org.apache.openjpa.persistence.PersistenceException: org.apache.openjpa.jdbc.kernel.exps.Count@336eb7fc
      FailedObject: SELECT b.oid, COUNT(b) FROM Book b where b.dueDate BETWEEN :start AND :end GROUP BY b.oid [java.lang.String]
      at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5008)
      at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4968)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:135)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:116)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:68)
      at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155)
      at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.handleCheckedException(QueryImpl.java:2111)
      at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:40)
      at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
      at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
      at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:275)
      at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:291)
      at org.apache.openjpa.persistence.jdbc.sqlcache.TestMultiThreadedQuery$Worker.run(TestMultiThreadedQuery.java:94)
      Caused by: java.sql.SQLException: org.apache.openjpa.jdbc.kernel.exps.Count@336eb7fc
      at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.findObject(SelectImpl.java:2512)
      at org.apache.openjpa.jdbc.sql.ResultSetResult.translate(ResultSetResult.java:497)
      at org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(ResultSetResult.java:362)
      at org.apache.openjpa.jdbc.sql.AbstractResult.getObject(AbstractResult.java:691)
      at org.apache.openjpa.jdbc.kernel.exps.UnaryOp.load(UnaryOp.java:120)
      at org.apache.openjpa.jdbc.kernel.ProjectionResultObjectProvider.getResultObject(ProjectionResultObjectProvider.java:78)
      at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.getResultObject(QueryImpl.java:2075)
      at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36)
      ... 8 more

        Attachments

        1. OPENJPA-2493.ut.patch
          5 kB
          Richard G. Curtis

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              curtisr7 Richard G. Curtis
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: