OpenJPA
  1. OpenJPA
  2. OPENJPA-1218

Cache.evict(Clazz) should remove subclasses as well

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M1, 2.0.0-M2, 2.0.0
    • Fix Version/s: 2.0.0-M3
    • Component/s: datacache
    • Labels:
      None

      Description

      This problem was discovered while working a separate issue with the EHCache plugin developer (Craig Andrews). The complete exchange can be found on this EHCache bug tracker [1]. According to the latest JPA 2.0 spec, the contract for Cache.evict(Clazz) is as follows:

      /**

      • Remove the data for entities of the specified class (and its
      • subclasses) from the cache.
        */
        public void evict(Class cls);

      But, we are not removing the subclasses. We need to change our implementation of Cache.evict(Clazz) to be consistent with the spec.

      Also, as we were digging into this area of the code, the internal OpenJPA DataCache implementation of the removeAllInternal(Clazz, boolean) method is not taking the boolean into account. We should correct this implementation at the same time.

      Thanks,
      Kevin

      [1] https://sourceforge.net/tracker/index.php?func=detail&aid=2828752&group_id=93232&atid=603559

        Activity

        Kevin Sutter created issue -
        Michael Dick made changes -
        Field Original Value New Value
        Summary Cache.evit(Clazz) should remove subclasses as well Cache.evict(Clazz) should remove subclasses as well
        Original Estimate 0h [ 0 ]
        Remaining Estimate 0h [ 0 ]
        Michael Dick made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Michael Dick made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Donald Woods made changes -
        Fix Version/s 2.0.0-M3 [ 12314148 ]
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Michael Dick
            Reporter:
            Kevin Sutter
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development