Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326511

Summary: registerNewObject in nested UnitOfWork not working
Product: z_Archived Reporter: Frank Kuepper <Frank.Kuepper>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: critical    
Priority: P2 CC: Frank.Kuepper, ruebe356, sterba, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Frank Kuepper CLA 2010-09-29 06:47:31 EDT
Build Identifier: 2.0.0.v20091127-r5931, also tested with current 2.1.1 build

When creating a new object and registering it in a nested UnitOfWork with registerNewObject the object is not inserted into the database after commit of all (nested and top-level) UOW.

Using registerObject for all registrations is no option for us because of the performance impact of unnecessary existence checks.

Reproducible: Always

Steps to Reproduce:
1. acquire a top-level UOW from the session
2. acquire a nested UOW
3. create a new object
4. register the new object on the nested UOW with registerNewObject
5. commit nested UOW
6. commit top-level UOW
Comment 1 Tom Ware CLA 2010-10-07 10:49:18 EDT
Setting target and priority.  See the following page for details of the meanings of these:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 2 Peter Sterba CLA 2012-11-09 02:36:42 EST
I may have a similiar problem.
I have found out, that it does perform well in old versions of TopLink. It worked on 9.0.3 and 9.0.4.8 but not on 10.1.3.0 and 10.1.3.3.

You may try to assign ID to the new object in nested UOW before commit to parent UOW - this worked in all TopLink versions and in EclipseLink as well.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:27:51 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink