Hi all,
I read a book explaining about lock mode. - shared & exclusive lock.
It says, shared lock can be shared by some compatible sessions(?).
and exlcusive lock is just for one session modifying data so, anyone altering the same row is prevented from Oracle.
But, here is another case.
"TX Lock - row lock contention wait event"
Let's say,"dept" table has a column named, "deptno" for department number, and it has PK constraint.
and "Trasaction 1" inserts one row containing deptno "40".
and the other "Transaction 2" inserts one row containing deptno "40", too.
Since the dept table has PK constraint, transaction 2 will be blocked before transaction 1 is committed or rollbacked to check the PK violation.
In other words, transaction 2 is waiting for row lock contention wait event.
In this book, this case, the wait event is occured in "SHARED" lock mode.
but transaction 2 is blocked. Does shared lock mode can block other sessions?
i thought shared mode is just for sharing some data, not blocking any other sessions.(but shared lock can block exclusive lock.)
i can not undestand shared & exclusive lock mode.