OpenJPA
  1. OpenJPA
  2. OPENJPA-1941

Criteria query returns wrong result when query cache is enabled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.1, 2.0.2
    • Fix Version/s: 2.1.0, 2.2.0
    • Component/s: datacache, jpa
    • Labels:
      None
    • Environment:
      The issue was detected when using a criteria query against Oracle database.

      Description

      When query cache is not enabled the queries return these lines: Query 1: 1 Query 2: 2 This is correct.
      When query cache is enabled the queries return these lines: Query 1: 1 Query 2: 1 This is wrong.

      See attached test case (Netbeans project). ojdbc14.jar and openjpa-all-2.0.1.jar must be added to the project.

      1. JpaCriteriaQueryCacheIssue.zip
        14 kB
        Guido Mueller
      2. jpacriteriaquerycacheissue.sql
        0.9 kB
        Guido Mueller

        Issue Links

          Activity

          Guido Mueller created issue -
          Guido Mueller made changes -
          Field Original Value New Value
          Attachment JpaCriteriaQueryCacheIssue.zip [ 12471265 ]
          Attachment jpacriteriaquerycacheissue.sql [ 12471266 ]
          Hide
          Guido Mueller added a comment -

          The problem also occurs with EHCache is enabled instead of the the native OpenJPA cache.

          Show
          Guido Mueller added a comment - The problem also occurs with EHCache is enabled instead of the the native OpenJPA cache.
          Guido Mueller made changes -
          Affects Version/s 2.1.0 [ 12314542 ]
          Hide
          Guido Mueller added a comment -

          The problem is gone in 2.2.0 SNAPSHOT

          Show
          Guido Mueller added a comment - The problem is gone in 2.2.0 SNAPSHOT
          Guido Mueller made changes -
          Affects Version/s 2.0.2 [ 12315257 ]
          Fix Version/s 2.2.0 [ 12315910 ]
          Michael Dick made changes -
          Assignee Michael Dick [ mikedd ]
          Hide
          Michael Dick added a comment -

          Thanks for letting us know - I'll see if I can track down the change that fixed it.

          Show
          Michael Dick added a comment - Thanks for letting us know - I'll see if I can track down the change that fixed it.
          Michael Dick made changes -
          Link This issue duplicates OPENJPA-1575 [ OPENJPA-1575 ]
          Hide
          Michael Dick added a comment -

          I wasn't able to reproduce this on OpenJPA 2.1.0. It does exist on 2.0.1 and 2.0.0.

          Looking through the commit history this appears to be fixed by excluding certain queries from the query cache (OPENJPA-1575).

          Show
          Michael Dick added a comment - I wasn't able to reproduce this on OpenJPA 2.1.0. It does exist on 2.0.1 and 2.0.0. Looking through the commit history this appears to be fixed by excluding certain queries from the query cache ( OPENJPA-1575 ).
          Hide
          Michael Dick added a comment -

          I'm going to resolve the issue as a dup for now. Please comment / reopen if you can reproduce on 2.1.0.

          Show
          Michael Dick added a comment - I'm going to resolve the issue as a dup for now. Please comment / reopen if you can reproduce on 2.1.0.
          Michael Dick made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.1.0 [ 12314542 ]
          Resolution Duplicate [ 3 ]
          Michael Dick made changes -
          Affects Version/s 2.1.0 [ 12314542 ]
          Hide
          Guido Mueller added a comment -

          I can acknowledge the problem is fixed in 2.1.0 final. One issue may be that 2.1.0 is officially supported only with JDK 6.

          Show
          Guido Mueller added a comment - I can acknowledge the problem is fixed in 2.1.0 final. One issue may be that 2.1.0 is officially supported only with JDK 6.
          Michael Dick made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          67d 17h 7m 1 Michael Dick 26/Apr/11 04:35
          Resolved Resolved Closed Closed
          78d 12h 35m 1 Michael Dick 13/Jul/11 17:11

            People

            • Assignee:
              Michael Dick
              Reporter:
              Guido Mueller
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development