OpenJPA
  1. OpenJPA
  2. OPENJPA-1006

Disabling QueryCaching at runtime does not work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 2.0.0-M2
    • Fix Version/s: 1.1.1, 2.0.0-M2
    • Component/s: datacache
    • Labels:
      None
    • Environment:
      N/A.
      should be replicable on all environments.
      The one I tried is on windows with oracle 10g as database.

      Description

      An application has a configuration that allows query caching, but is making runtime calls to inform a fetch plan to disable query caching.

      The bug is that this dynamic no-caching request is being ignored by the query cache executor, which then caches the query regardless.

      Tried to disable query cache using
      OpenJPAEntityManager.getFetchPlan().setQueryResultCache(false);

      and also

      query.getFetchPlan().setQueryResultCacheEnabled(false);

      1. openJPATestcase.zip
        8 kB
        Ravi P Palacherla
      2. OPENJPA-1006.patch
        2 kB
        Ravi P Palacherla
      3. TestQueryResultSize.java
        3 kB
        Ravi P Palacherla

        Activity

        Hide
        David Ezzio added a comment -

        From trunk, merged fix to 1.1.x branch at 802203

        Show
        David Ezzio added a comment - From trunk, merged fix to 1.1.x branch at 802203
        Hide
        David Ezzio added a comment - - edited

        Fix in trunk, rev 765801, and MISIDENTIFIED as fix for OpenJPA-1002. (The misidentification has been corrected.)

        Show
        David Ezzio added a comment - - edited Fix in trunk, rev 765801, and MISIDENTIFIED as fix for OpenJPA-1002. (The misidentification has been corrected.)
        Hide
        Ravi P Palacherla added a comment -

        Note to committer:

        Please commit my changes and let me know of any issues.

        Regards,
        Ravi.

        Show
        Ravi P Palacherla added a comment - Note to committer: Please commit my changes and let me know of any issues. Regards, Ravi.
        Hide
        Ravi P Palacherla added a comment -

        Attached is the .patch and test case ( new ).

        I ran mvn test -Dtest=TestQueryResultSize.
        I got assertion error.
        Fixed the code attached in .patch file.
        ran mvn test -Dtest=TestQueryResultSize.
        The last test run is successfull.

        Ran mvn -o clean package and I see the following :
        [INFO] OpenJPA ............................................... SUCCESS [4.032s]
        [INFO] OpenJPA Utilities ..................................... SUCCESS [14.313s]
        [INFO] OpenJPA Kernel ........................................ SUCCESS [15.562s]
        [INFO] OpenJPA JDBC .......................................... SUCCESS [11.375s]
        [INFO] OpenJPA JPA ........................................... SUCCESS [6.344s]
        [INFO] OpenJPA JPA JDBC ...................................... SUCCESS [1:04:15.672s]
        [INFO] OpenJPA XML Store ..................................... SUCCESS [1.562s]
        [INFO] OpenJPA Slice ......................................... SUCCESS [2:06.719s]
        [INFO] OpenJPA Aggregate Jar ................................. SUCCESS [9.531s]
        [INFO] OpenJPA Distribution .................................. SUCCESS [20.719s]
        [INFO] OpenJPA Persistence Examples .......................... SUCCESS [1.359s]
        [INFO] OpenJPA Integration Tests ............................. SUCCESS [0.297s]
        [INFO] OpenJPA Examples Integration Tests .................... SUCCESS [0.297s]
        [INFO] OpenJPA JPA TCK Integration Tests ..................... SUCCESS [0.703s]

        Show
        Ravi P Palacherla added a comment - Attached is the .patch and test case ( new ). I ran mvn test -Dtest=TestQueryResultSize. I got assertion error. Fixed the code attached in .patch file. ran mvn test -Dtest=TestQueryResultSize. The last test run is successfull. Ran mvn -o clean package and I see the following : [INFO] OpenJPA ............................................... SUCCESS [4.032s] [INFO] OpenJPA Utilities ..................................... SUCCESS [14.313s] [INFO] OpenJPA Kernel ........................................ SUCCESS [15.562s] [INFO] OpenJPA JDBC .......................................... SUCCESS [11.375s] [INFO] OpenJPA JPA ........................................... SUCCESS [6.344s] [INFO] OpenJPA JPA JDBC ...................................... SUCCESS [1:04:15.672s] [INFO] OpenJPA XML Store ..................................... SUCCESS [1.562s] [INFO] OpenJPA Slice ......................................... SUCCESS [2:06.719s] [INFO] OpenJPA Aggregate Jar ................................. SUCCESS [9.531s] [INFO] OpenJPA Distribution .................................. SUCCESS [20.719s] [INFO] OpenJPA Persistence Examples .......................... SUCCESS [1.359s] [INFO] OpenJPA Integration Tests ............................. SUCCESS [0.297s] [INFO] OpenJPA Examples Integration Tests .................... SUCCESS [0.297s] [INFO] OpenJPA JPA TCK Integration Tests ..................... SUCCESS [0.703s]
        Hide
        Ravi P Palacherla added a comment -

        Attached is the test case.

        To replicate the problem:

        1) Modify build.xml to reflect your environment. ( e.g: patch where the libraries for openJPA exist )
        2) "ant"
        3) "ant test"

        Show
        Ravi P Palacherla added a comment - Attached is the test case. To replicate the problem: 1) Modify build.xml to reflect your environment. ( e.g: patch where the libraries for openJPA exist ) 2) "ant" 3) "ant test"

          People

          • Assignee:
            David Ezzio
            Reporter:
            Ravi P Palacherla
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development