Community
Participate
Working Groups
Created attachment 150322 [details] Simplist case to reproduce the problem I have two objects (call them A) mapped to the same table, one read only and one read/write. Another object (call it N) holds a reference to the read only version and maps it with a read only mapping. N has a collection of privately owned objects. If, in the same transaction, a new read/write A is created and saved, then copied to a read only and given to N, and then N is saved, the privately owned objects of N sometimes fail to save to the database, but exist in cache.
I debugged the code, and it seems to be a problem with UnitOfWorkImpl.discoverUnregisteredNewObjects(Map, Map, Map, Map) It creates one DescriptorIterator, and then uses it on every clone. If the ReadOnly parent (A) clone is hit before the main object (N), the shouldBreak field of the DescriptorIterator is set to true for the ReadOnly parent and all subsequent objects. This causes the main object (N) to skip the iterateReferenceObjects. The private owned objects are thus not removed from the field privateOwnedObjects in the UnitOfWorkImpl, and are thus unregistered later in UnitOfWorkImpl.calculateChanges(Map, UnitOfWorkChangeSet, boolean).
Setting target and priority. See the following page for details of what this means: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
This bug fix did not make the cut off for 2.0.0. We are deferring the bugs to Future where we can properly sort them all together based on community votes and severity. We will then assign them accordingly to future patch sets and releases.
Changing the priority of the bugs that have been recently triaged to future. Targetting them to P2 will differentiate them from the P3s that have been triaged into future earlier.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink