openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey" <>
Subject RE: deferring fk constraints problem
Date Sat, 18 Nov 2006 05:42:12 GMT
The good news is that you can always work around this my manually
flushing at the right times.


Patrick Linskey
BEA Systems, Inc. 

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. 

> -----Original Message-----
> From: roger.keays [] 
> Sent: Thursday, November 16, 2006 11:37 PM
> To:
> Subject: deferring fk constraints problem
> Okay, so I'm a bit of a referential integrity fanatic.
> 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
> <cascade-delete/> tries to delete the owned object first, but 
> the owner must
> be deleted first since the constraint is non-deferrable. 
> There is no problem
> in inverse-mapped relationships because the fk is in the 
> owned table, not
> the owner's.
> Am I making sense?
> The problem is worked around by making the fk SET NULL 
> instead of RESTRICT,
> but that isn't necessarily always what you want. 
> It might also be useful to provide different fk configuration 
> options for
> forward and reversed mapped fk's (i.e. ForeignKeyDeleteAction,
> InverseForeignKeyDeleteAction).
> Roger
> -- 
> View this message in context: 
> Sent from the open-jpa-dev mailing list archive at

View raw message