Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> problem with foreign key
hi all,
I have two tables:
CREATE TABLE PARENT (
ID NUMBER NOT NULL,
NAME VARCHAR2(100),
CONSTRAINT PK_PARENT PRIMARY KEY(ID)
) ;
CREATE TABLE CHILD (
ID NUMBER NOT NULL,
DT DATE DEFAULT sysdate NOT NULL,
PID NUMBER NOT NULL,
CONSTRAINT PK_CHILD PRIMARY KEY(ID), CONSTRAINT FK_CHILD FOREIGN KEY(PID) REFERENCES PARENT(ID) ON DELETE CASCADE);
transaction 1: delete a row in the parent table *without* a commit transaction 2: wants to insert a row in the CHILD-table
*problem*: transaction 2 wait until transaction 1 send a commit!!!
(rem: I have tested it without ON DELETE CASCADE and with ON DELETE SET NULL.)
is it true, that oracle lock the whole child-table, while deleting a parentkey
?
or can I do something else?
thanx in advance
Rüdiger
(eMail: rjs_at_berlin.de)
-- __________________________________________________________ News suchen, lesen, schreiben mit http://newsgroups.web.deReceived on Mon Oct 08 2001 - 08:30:12 CDT
![]() |
![]() |