OpenJPA
  1. OpenJPA
  2. OPENJPA-1884

CacheStoreMode.REFRESH is not recognized for entity manager refresh operation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.1
    • Component/s: datacache
    • Labels:
      None

      Description

      Specifying the "javax.persistence.cache.storeMode" property with value CacheStoreMode.REFRESH does not refresh the contents of the L2 cache when used with the em.refresh(entity, props) operation.

      OPENJPA-1578 corrected this a similar issue for the em.find() operation, but not em.refresh(). A simple port of the changes from 1578 (which simply configure the store mode in the fetch plan) to the refresh operation did not correct the problem. It appears that more work needs to be done in the underlying refresh logic to produce a cache refresh.

      1. OPENJPA-1884-jUnit.patch
        5 kB
        Jeremy Bauer
      2. OPENJPA-1884.patch
        14 kB
        Jeremy Bauer

        Activity

        Jeremy Bauer created issue -
        Hide
        Jeremy Bauer added a comment -

        Attaching a jUnit which demonstrates the issue.

        Show
        Jeremy Bauer added a comment - Attaching a jUnit which demonstrates the issue.
        Jeremy Bauer made changes -
        Field Original Value New Value
        Attachment OPENJPA-1884-jUnit.patch [ 12465256 ]
        Hide
        Jeremy Bauer added a comment -

        Attaching fix and updated test code. In addition to handling updates, this fix also purges entries from the L2 when the property javax.persistence.cache.storeMode is set to CacheStoreMode.REFRESH and the refresh operation determines the entity no longer exists in the underlying datastore/database.

        Show
        Jeremy Bauer added a comment - Attaching fix and updated test code. In addition to handling updates, this fix also purges entries from the L2 when the property javax.persistence.cache.storeMode is set to CacheStoreMode.REFRESH and the refresh operation determines the entity no longer exists in the underlying datastore/database.
        Jeremy Bauer made changes -
        Attachment OPENJPA-1884.patch [ 12465305 ]
        Hide
        Jeremy Bauer added a comment -

        Attaching updated patch containing performance update that eliminates a cache get when storemode=bypass (the default).

        Show
        Jeremy Bauer added a comment - Attaching updated patch containing performance update that eliminates a cache get when storemode=bypass (the default).
        Jeremy Bauer made changes -
        Attachment OPENJPA-1884.patch [ 12465381 ]
        Jeremy Bauer made changes -
        Attachment OPENJPA-1884.patch [ 12465305 ]
        Rick Curtis made changes -
        Fix Version/s 2.1.1 [ 12316191 ]
        Hide
        Rick Curtis added a comment -

        Closing.

        Show
        Rick Curtis added a comment - Closing.
        Rick Curtis made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        139d 2h 16m 1 Rick Curtis 31/Mar/11 22:05

          People

          • Assignee:
            Jeremy Bauer
            Reporter:
            Jeremy Bauer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development