|Re: [eclipselink-dev] Regarding Bug #334899|
Sorry for the slow response.
I do not have any philosophical issue with address this, but please be aware of one gotcha.
For relationships in a cycle (e.g. a -> b -> c -> a), on insert, EclipseLink will pick a place in the cycle and insert with the foreign key == null and immediately after the set of inserts is done update the null foreign key to point to the correct entity. We call this a shallow insert (and googleing may yield some results showing alot of debate over that functionality).
The reason for this functionality is to allow foreign key constraints to work. i.e. Until c is inserted, I cannot set the foreign key in the b -> c mapping. Any fix you will either have to allow shallow updates to work, or it will break backward compatibility. Some databases allow deferral of constaints until commit, but not all of them, so assuming constraints can be deferred is not an option.
On 17/07/2014 1:32 PM, Jody Grassel wrote:
Back to the top