enq: TX - row lock contention for foreign key
HI All,
My DB is 11.2 exadata machine.
I happend to get a case and don't know how to explain it.
session 1:
create table parent (
id number primary key);
create table child (
id number references parent,
name varchar2(20));
insert into parent values (3);
session 2:
insert into child values (3,'aa');
Session 2 hangs.
I am curious how oracle knows that 3 in parent table could be inserted? Othewise, why don't oracle just throw ORA-02291:parent key not found immediately as I issue 'insert into child values (3,'aa');'
Best regards,
Leon