Bug 373259 - Cannot have a cyclic dependency with a non-null foreign key constraint
Summary: Cannot have a cyclic dependency with a non-null foreign key constraint
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-05 10:31 EST by Michael Keith CLA
Modified: 2022-06-09 10:32 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Keith CLA 2012-03-05 10:31:33 EST
EclipseLink does a shallow insert in the case of cyclic dependencies, writing out null in the foreign key column in the first write and then subsequently filling it in with the correct foreign key. However, if the foreign key has a non-null constraint on it, with integrity constraint checking set on the foreign key to be deferred until commit, there is no way to do the insertion.

See http://www.eclipse.org/forums/index.php/t/298970

Eclipse should have an option to force it to go ahead and write the foreign key on the first pass. It would need to assume the schema has been set with deferred constraint checking options. The best way to offer this is probably through the "nullable" element of the @JoinColumn annotation. If it is set to false for the mapping then shallow inserts should not be done.
Comment 1 Tom Ware CLA 2012-03-06 09:37:10 EST
The suggestion we have made in the past for this issue is, to set deferred null checking options.
Comment 2 Tom Ware CLA 2012-03-15 13:38:04 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 3 Eclipse Webmaster CLA 2022-06-09 10:16:15 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:32:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink