Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312311

Summary: JPA: Cache invalidation does not check existing invalidation state
Product: z_Archived Reporter: Michael OBrien <michael.f.obrien>
Component: EclipselinkAssignee: Project Inbox <eclipselink.orm-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipselink.orm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 312503    
Bug Blocks:    

Description Michael OBrien CLA 2010-05-10 13:47:59 EDT
>The following IdentityMapAccessor.invalidateClass() code can be optimized to check the invalidationState before resetting it to CACHE_KEY_INVALID=-1.

If the recurse boolean is set to true and all implementing subclasses of a particular class in the identityMap are invalidated in a single invalidateClass() call then code that references individual classes of this invalidated inheritance tree will re-invalidate the keys unnecessarily.

>The following key is already invalidated
key	HardCacheWeakIdentityMap$ReferenceCacheKey  (id=123)	
	invalidationState	-1	

>in a previous call to 
    public void invalidateClass(Class myClass, boolean recurse) {
...
            if (recurse || ((obj != null) && obj.getClass().equals(myClass))) {
                key.setInvalidationState(CacheKey.CACHE_KEY_INVALID);

>See implementor CacheImpl.evict() in bug# 248780
Comment 1 Michael OBrien CLA 2010-06-03 10:04:19 EDT
>this enhancement still occurs but is modified because of the optimization in bug# 312503
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:10:35 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:15:35 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink