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

Bug 336741

Summary: Removed entity obtained with getRefrence is not removed from cache
Product: z_Archived Reporter: Adrian Goerler <adrian.goerler>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P2 CC: eclipselink.foundation-inbox, konstantin.schwed, krum.tsvetkov, sabine.heider, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 336726    

Description Adrian Goerler CLA 2011-02-09 12:55:56 EST
The following sequence fails for cacheable entities:

Object ref = em.getRefrerence(MyCacheableEntity, id)
em.remove(ref);
em.getTx().commit();
em.clear();

assertNull(em.find(MyCacheableEntity, id));

Its seams that the reference is not removed from the cache. If i disable caching, the above sequence succeeds.

The issue can be reproduced by 

eclipselink.jpa.wdf.test
- org.eclipse.persistence.testing.tests.wdf.jpa1.entitymanager.TestGetReference
  - testRemove

As a prerequisite caching must be enabled (selectively): https://bugs.eclipse.org/bugs/attachment.cgi?id=188603
Comment 1 Tom Ware CLA 2011-06-08 09:52:51 EDT
see also: bug  336731 and bug 336741
Comment 2 Tom Ware CLA 2011-08-23 09:46:22 EDT
Fix for 336726 fixes this.

*** This bug has been marked as a duplicate of bug 336726 ***
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:26:14 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink