Bug 293116 - A combination of read only and private owned mappings may fail to save.
Summary: A combination of read only and private owned mappings may fail to save.
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-22 19:02 EDT by Jim CLA
Modified: 2022-06-09 10:33 EDT (History)
1 user (show)

See Also:


Attachments
Simplist case to reproduce the problem (2.04 KB, application/octet-stream)
2009-10-22 19:02 EDT, Jim CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim CLA 2009-10-22 19:02:38 EDT
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.
Comment 1 Jim CLA 2009-10-22 19:09:49 EDT
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).
Comment 2 Tom Ware CLA 2009-10-29 11:53:10 EDT
Setting target and priority.  See the following page for details of what this means:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 3 Peter Krogh CLA 2009-11-27 13:41:59 EST
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.
Comment 4 Peter Krogh CLA 2009-11-30 11:38:02 EST
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.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:33:08 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink