Re: Oracle Lock problem ! i really need help !

From: Dan McEvoy <mcevoy_at_hatchcos.com>
Date: 1996/11/12
Message-ID: <32890AC6.EBC_at_hatchcos.com>#1/1


Guillaume MAISON wrote:
>
> Hi all !
>
> Before, i have to say that i'm quite new to Oracle...
> i'm using Oracle 7.0.16.6.5 on a Netware (3.12) server.
>
> Here's my problem :
>
> i have two tables A & B.
> B references A by a foreign key.
>
> On the first station, when i insert a row into table B, just before the
> insert, i run a stored procedure which insert a row in table A.
> but the commit isn't made immediatly. i have to do several things before
> the commit (or rollback) which can take a long time.
>
> On the second station, i try to do the same thing (i mean inserting a
> row in table B and just before this insert, running the stored procedure
> which insert into table A), i can't launch the stored procedure.
> On this second station, eveerything is stopped, waiting for the first
> station to commit or rollback.
>
> after few searches, i've found that inserting into table A on the first
> station locks the entire table B, and so i can't do anything with table
> B from another station.
>
> coud anyone help me ?!
>
> i need a really urgent answer !
>
> e-mail me the answer (or if you need more details)at : maison_at_easynet.fr
>
> Thanks in advance !
>
> Guillaume
If you create an index on table B on the foreign key or referenced column then you will only lock a single row in table A. When you do not haave an index on table B the it locks the entire table.

Of course ensuring a commit or rollback as soon as possible will release the locks. Received on Tue Nov 12 1996 - 00:00:00 CET

Original text of this message