User Id :    Password :      New Member   Forgot Password  
Topic: What is a deadlock and what is a live lock? How will you go about resolving deadlocks
Sachin Jain
30 Oct 2010 at 02:58 AM

What is a deadlock and what is a live lock? How will you go about resolving deadlocks?

Re: What is a deadlock and what is a live lock? How will you go about resolving deadlocks
Gaurav
31 Oct 2010 at 10:41 PM

Deadlock is a situation when two processes, each having a lock on one piece of data, attempt to acquire a lock on the other's piece. Each process would wait indefinitely for the other to release the lock, unless one of the user processes is terminated. SQL Server detects deadlocks and terminates one user's process.

A Live lock is one, where a request for exclusive lock is denied continuously because a series of overlapping shared locks keeps on interfering each other and to adapt from each other they keep on changing the status which further prevents them to complete the task. In SQL Server Live Lock occurs when read transactions are applied on table which prevents write transaction to wait indefinitely. This is different then deadlock as in deadlock both the processes wait on each other.

A human example of live lock would be two people who meet face-to-face in a corridor and each move aside to let the other pass, but they end up moving from side to side without making any progress because they always move the same way at the same time and never cross each other. This is good example of live lock.

Total Replies: 1
 
Featured Text Ad

Featured Ad