Re: FOREIGN KEY constraint

From: Mike Bernier <mbernier_at_wtc34a.DaytonOH.NCR.COM>
Date: 27 Apr 94 13:06:06 GMT
Message-ID: <1012_at_wtc34a.DaytonOH.NCR.COM>


In article <2pirep$e6c_at_dockmaster.phantom.com> ynp_at_phantom.com (Youri Podchosov) writes:
>Does anybody have anything to say about table/column level constraint
>FOREIGN KEY? Any warnings/observations/cautions? How does it compare to
>database triggers used for the same purpose?
>

Youri,

When using declarative referential integrity, you have to be aware of how Oracle locks the parent child table. If the foreign key in the child table is indexed, a row level lock is applied on the appropriate parent row but if the foreign key is not indexed, the COMPLETE PARENT TABLE is LOCKED, essentially prohibiting parent table updates until any child table updates have been committed or rolled back. Please reference pages 6-9 through 6-11 in the Oracle7 Server Application Developer's Guide.

I submitted a business case to have this locking behavior be more rational in suppport of request for enhancement 169428.

I hope this helps.

Mike Bernier Received on Wed Apr 27 1994 - 15:06:06 CEST

Original text of this message