-
Bug
-
Resolution: Done
-
Major
-
4.2.0.GA_CP09, 4.3.0.GA_CP08
-
None
-
Release Notes
-
Workaround Exists
-
-
The cascade-save operation was incorrectly handling auto-incremented Primary Key (PK) tables that linked to parent tables with an assigned PK. The fix now allows the cascade-save operation to handle the parent-child relationship between tables.
-
Documented as Resolved Issue
Consider:
a table with an assigned PK (i.e. not auto-increment), let's call this "A"
Another table ("B") linked to the table listed above but with it's PK set to auto-increment.
Now if you try to save B with cascading switched on, it will break. From the little debugging I've done it looks like:
a) hibernate detects that A needs to be saved first, but puts it into some sort of queue.
b) when it hits B, it short-circuits this save queue and tries to save B immediately so as to obtain a PK reference for B. This fails since A hasn't been yet been saved so it's link is still null.
----------
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3334
- relates to
-
JBPAPP-4926 HHH-3334 Cascade-save breaks if parent ID is assigned (delays insert) and child has identity ID (early insert)
- Closed