Community
Participate
Working Groups
Intermittent failures are encountered when using CascadeType.PERSIST, it throws java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: This is typically observed with unregistered objects which are discovered during flush() or commit(). EntityX OneToOne EntityY EntityZ OneToMany EntityY EntityY is marked as cascade persist from EntityZ relation, but not from EntityX relationship. If EntityX and EntityY are persisted using em.persist(), and EntityY is set on both EntityX and EntityZ with flush() called, this intermediate failure is observed.
Created attachment 194120 [details] Testcase source Steps to reproduce: 1. Unzip, and load project in Eclipse. 2. Change database related entries in persistence.xml 3. Change driver settings and eclipselink.jar location in eclipse project. 4. Execute StandaloneTestCase JUnit test to reproduce the issue.
Created attachment 194187 [details] Fix including the test case
Fixed in EL trunk At revision: 9285
*** Bug 217505 has been marked as a duplicate of this bug. ***
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink