Community
Participate
Working Groups
Created attachment 282859 [details] Maven project reproducing the issue Scenario: Entity A: exists in DB, not currently in L2 cache Entity B: new entity being created, has association to entity A but at the start of the transaction, it only has the Id of entity A (detached status). Also - some of the attributes of entity A object linked to the entity B may be dirty. Issue: After an existence check for entity A (as expected) entity B is persisted correctly. Unfortunately the entity A object (from the association) appears to be directly placed into L2 cache as-is (including any dirty state it brought along). Subsequent em.find() reveals it. Expected result: I would expect the detached copy of entity B to NOT be put in L2 cache simply following the existence check. The last em.find() should find that the object is not in the PU cache and go to the database. Reproduction: See attached reproduction tested in 2.7.6 (version not available in dropdown in Bugzilla). mvn test should pass but it will fail.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink