Re: Table Locking problem

From: Benjamin Krug <benkrug_at_mcs.com>
Date: 1995/12/19
Message-ID: <4b7803$il1_at_News1.mcs.net>#1/1


In article <4b4u4t$qb_at_news2.cts.com>, saii_at_crash.cts.com (Systems Integrated) says:
>
>
>Hi,
>I'm having some unexpected trouble with locking.
>I have two tables, B and I. There is a foreign key on I that
>references the primary key on B. When this foreign key is
>added, then I cannot delete a record from B one transaction, and
>delete another record from B from another transaction. The first
>goes through, and the second hangs until the first is committed.
>The records in I do not point to the records in B that I wish to
>delete.
>
>There are many foreign key constraints on B, but only a couple
>exhibit this behavior.
>
>Any ideas on this?
>
>
>Thanks in advance for any ideas.
>
>
>Gene Plagge
>System Integrated, Inc.
>619-277-0700
>email: gplagge_at_siwest.cts.com
>
>
>
You need to create indexes on the foreign key column in the child table! (Don't ask me why, I don't know. We had the same problem, though. Without the index, the update takes out a table lock on the parent!)

Ben Krug
benkrug_at_mcs.com Received on Tue Dec 19 1995 - 00:00:00 CET

Original text of this message