Friday, October 24, 2008

So far you have heard about Deadlock where this Livelock comes in?

Deadlock, if a process acquires a lock on a piece of data and another process is also looking for the same piece of data but due to first process waiting indefinitly then it would become a Deadlock, unless one of the user processes is terminated. SQL Server detects Deadlock and terminates one user's process.

Livelock, if a process's exclusive lock request is repeatedly denied due to series of overlapping shared locks then it would become a Livelock, SQL Server detects the Livelock and after 3 denials terminates the Livelock. Another example of Livelock; when a read transaction hold a lock on a table and forcing a write transaction to wait indefinitly.

 

Bandagi!

10/29/2008 9:47:31 PM UTC
The following is not a deadlock:

Deadlock, if a process acquires a lock on a piece of data and another process is also looking for the same piece of data but due to first process waiting indefinitly then it would become a Deadlock

For a deadlock to happen, process 1 locks resource 1 while running and issues a request to lock resource 2. Process 2 has already locked resource 2 while running and issues a request to lock resource 1. So they are waiting on one another as in a vicious cycle, which may never end.

sqlteam
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):