OpenJPA
  1. OpenJPA
  2. OPENJPA-1151

Cache the current-time timestamp in AbstractQueryCache.onTypesChanged()

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.3.0, 2.0.0
    • Fix Version/s: 1.3.0, 2.0.0-M3
    • Component/s: jdbc
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      AbstractQueryCache.java contains the following block:

      for (Object o: changedTypes)

      { String name = ((Class) o).getName(); if(!changedClasses.containsKey(name)) changedClasses.put(name, new Long(System.currentTimeMillis())); }

      Suggesting caching the Long containing the entity type's last-modification timestamp outside of the for-loop to improve performance and reduce memory usage.

      1. OpenJPA-trunk-JIRA1151-tests.patch
        20 kB
        Jody Grassel
      2. OpenJPA-trunk-JIRA1151.patch
        20 kB
        Jody Grassel

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        75d 22h 33m 1 Donald Woods 14/Sep/09 19:52
        Resolved Resolved Reopened Reopened
        17h 34m 1 Donald Woods 15/Sep/09 13:26
        Reopened Reopened Resolved Resolved
        5h 19m 1 Donald Woods 15/Sep/09 18:46
        Resolved Resolved Closed Closed
        174d 23h 44m 1 Donald Woods 09/Mar/10 18:31
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Donald Woods made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Donald Woods added a comment -

        test failures on other dbs fixed by Fay with r815366 and r815369.

        Show
        Donald Woods added a comment - test failures on other dbs fixed by Fay with r815366 and r815369.
        Donald Woods made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Donald Woods added a comment -

        patch caused some test regressions on MySQL and Oracle

        Show
        Donald Woods added a comment - patch caused some test regressions on MySQL and Oracle
        Donald Woods made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Donald Woods added a comment -

        Trunk tests applied as r814807.

        Show
        Donald Woods added a comment - Trunk tests applied as r814807.
        Donald Woods made changes -
        Fix Version/s 1.3.0 [ 12313326 ]
        Fix Version/s 2.0.0-M3 [ 12314148 ]
        Affects Version/s 1.3.0 [ 12313326 ]
        Affects Version/s 2.0.0 [ 12314019 ]
        Hide
        Donald Woods added a comment -

        Code patch already applied by Mike on June 30th to 1.3.x and trunk. Only testcase updates need to be applied now.

        Show
        Donald Woods added a comment - Code patch already applied by Mike on June 30th to 1.3.x and trunk. Only testcase updates need to be applied now.
        Donald Woods made changes -
        Assignee Donald Woods [ drwoods ]
        Jody Grassel made changes -
        Attachment OpenJPA-trunk-JIRA1151-tests.patch [ 12412309 ]
        Hide
        Jody Grassel added a comment -

        Updated tests, based off of the HEAD release of trunk.

        Show
        Jody Grassel added a comment - Updated tests, based off of the HEAD release of trunk.
        Hide
        Jody Grassel added a comment -

        It looks like the class TestQueryTimestampEviction had changed since r708980. I'll make the necessary adjustments and resubmit.

        Show
        Jody Grassel added a comment - It looks like the class TestQueryTimestampEviction had changed since r708980. I'll make the necessary adjustments and resubmit.
        Hide
        Michael Dick added a comment -

        I'm not sure about the testcases included in the patch - they didn't merge cleanly for me. I have committed the timestamp caching portion of the fix though.

        Show
        Michael Dick added a comment - I'm not sure about the testcases included in the patch - they didn't merge cleanly for me. I have committed the timestamp caching portion of the fix though.
        Jody Grassel made changes -
        Field Original Value New Value
        Attachment OpenJPA-trunk-JIRA1151.patch [ 12412208 ]
        Hide
        Jody Grassel added a comment -

        Added a patch that caches the Long containing the current time used for cataloging when an entity type is modified for the timestamp query cache eviction policy.

        Added more testing for default and timestamp query cache eviction policies.

        Show
        Jody Grassel added a comment - Added a patch that caches the Long containing the current time used for cataloging when an entity type is modified for the timestamp query cache eviction policy. Added more testing for default and timestamp query cache eviction policies.
        Jody Grassel created issue -

          People

          • Assignee:
            Donald Woods
            Reporter:
            Jody Grassel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development