06.Deadlock - eshan3101/DataBase-Architech GitHub Wiki

What is a Deadlock?

A deadlock happens when:

Session 1 locks Row A and waits for Row B. Session 2 locks Row B and waits for Row A.

Now neither session can continue.

Oracle detects this automatically and throws:

** ORA-00060: deadlock detected while waiting for resource **

TERMINAL 1

TERMINAL 2

terminal 1 got hanged

terminal 2 got hanged

ROLLBACK

TERMINAL 2