Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Master-detail locking problem
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
![]() |
![]() |