Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Master-detail locking problem

Master-detail locking problem

From: Alexander Chupin <chupin_at_hotmail.ru>
Date: Mon, 12 Mar 2001 20:00:55 -0000
Message-ID: <98j9gl$pt7$1@soap.pipex.net>

Hi All,

I have found a strange effect. In order to reproduce it run the following script in SQL*plus window :

create table d ( a number, d number );
alter table d add constraint f_m_fk foreign key ( a ) references m(a); insert into m values( 1,1 );
commit;
insert into d values (1,1);
------- end of the script -----

after last insert statemet has been executed open new SQL*plus window and run the statement

update m set o=1 where a =1;

this statement waits till commit or
rollback is executed in the first sql*plus window.

In my opinion, this isn't correct behaviour. I can understand that oracle must lock
primary key field in the parent table,
but the field "o" should not be locked.

I've checked this behaviour for
8.1.6.0, 8.1.6.3 for sparc Solaris
8.0.5 for Windows NT

I also found out that the following statment in the trigger of table m is responsible for the locking:

    SELECT m_seq.NEXTVAL into :new.a FROM dual;

locking of field "o" doesn't occur if this statment is removed from the trigger body .

Thanx in advance
WBR, Alexander Chupin Received on Mon Mar 12 2001 - 14:00:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US