openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abe White <>
Subject Re: deferring fk constraints problem
Date Mon, 20 Nov 2006 17:29:31 GMT
> There may be a problem where the order of deletes causes fk constraint
> exceptions in certain cascade delete operations. The conditions for  
> this
> are:
>     * 1-1 forward mapped relationship
>     * relationship marked <cascade-delete/>
>     * fk action is 'restrict' (fk is in owner's table)
>     * database does not support deferred constraints

Yes, this is a problem for non-nullable keys.  Unfortunately there is  
no cascade order that's going to work reliably for all relationships  
for non-nullable keys.  We chose the current order because non- 
nullable forward keys are fairly rare.  It's a pain, but to work  
around it you'd have to get rid of the cascade (or null the  
relationship) and manually remove() the owner before the child.
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

View raw message