Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340810 - merge problem: existing object referenced by new not cascade merged if not in cache
Summary: merge problem: existing object referenced by new not cascade merged if not in...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-23 16:55 EDT by Andrei Ilitchev CLA
Modified: 2022-06-09 10:19 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Ilitchev CLA 2011-03-23 16:55:05 EDT
This bug is based on
Bug 340802 - merge problem: existing object referenced by new not cascade merged.

It happens even after bug 340802 is fixed.
To reproduce follow the scenario from bug 340802, but before merge clear the shared cache.

Not that after bug 340802 is fixed the merged B is correct in EntityManager cache.
However both in shared cache and in data base B still has the old state.
Comment 1 Andrei Ilitchev CLA 2011-03-23 17:39:11 EDT
James suggests that this bug should be fixed by changing merge process for new objects: for each new object to be merged create an empty object of the corresponding type and merge into it the new object. In that case there will be no more cascadeOnly merges. 
Should be careful because the same merging code is used in several scenarios - not only for merge operation. The code should be changed for merging from clone into working copy case only.
Comment 2 Andrei Ilitchev CLA 2011-03-23 17:40:47 EDT
The test for the bug is already checked in (though commented out for now): EntityManagerJUnitTestSuite.testMergeNewReferencingOldChanged - should be  uncommented when the bug is fixed.
Comment 3 Tom Ware CLA 2011-04-06 08:30:07 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:19:35 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink