Skip to content

06.Deadlock

eshan3101 edited this page Jul 28, 2026 · 1 revision

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 image

image image image image image image image

TERMINAL 2

image image image

terminal 1 got hanged image

terminal 2 got hanged image

ROLLBACK image

TERMINAL 2 image

Clone this wiki locally