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

NPE in QueryKey.createKey using criteria with QueryCache enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.1, 2.2.2, 2.3.0, 2.4.0
    • 2.2.1.1, 2.2.3, 2.4.0
    • criteria, datacache
    • None

    Description

      Running an example in the spec using Criteria API with "left join fetch" AND query cache enabled yield the following NPE exception. See the testcase to reproduce the problem and the spec section where the example comes from:

      <openjpa-2.2.1.1-SNAPSHOT-r422266:1438134 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Failed to execute query "null". Check the query syntax for correctness. See nested exception for details.
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:872)
      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:286)
      at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302)
      at com.ibm.ws.persistence.QueryImpl.getResultList(QueryImpl.java:118)
      at test.TestNPE.test(TestNPE.java:62)
      ......
      Caused by: java.lang.NullPointerException
      at org.apache.openjpa.datacache.QueryKey.createKey(QueryKey.java:203)
      at org.apache.openjpa.datacache.QueryKey.newInstance(QueryKey.java:139)
      at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeQuery(QueryCacheStoreQuery.java:339)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1005)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
      ... 33 more

      Attachments

        1. OPENJPA-2502.221x.patch
          25 kB
          Albert Lee
        2. OPENJPA-2502.test.zip
          6 kB
          Albert Lee

        Activity

          People

            jpaheath Heath Thomann
            allee8285 Albert Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: