Tuesday 1 April 2014

Wha is Deadlock?

A deadlock occurs when two or more session are waiting for data locked by each other, resulting in all the sessions being blocked.
Oracle automatically detects and resolves deadlocks by rolling back the statement associated with the transaction that detects the deadlock.


Error in alert file: Ora 00060



In above case deadlock occurs.

because each one have lock on each other tables.
1) like when user 1 updates t1 it put lock on it, at same time user2 updates t2 it put lock on it.
2) then user 1 updates t2,at same time user 2 updates on t1.
3) When user 1 tries to commit on it doesn't allow to commit since t2 hv lock by user2.
4) when user 2 tries to commit on it doesn't allow to commit since t1 hv lock by user1.

No comments:

Post a Comment