Explain about Dead-locks in Sql Server database

Questions by rbraja.testing

Showing Answers 1 - 6 of 6 Answers

rup

  • Jan 29th, 2007
 

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.

Deadlock occurs when two or more processes have lock objects and each process is trying to acquire a lock on an object that the other processes have previously locked.  Let p1 process  has an exclusive lock on object o1, p2 process  has an exclusive lock on object o2, and p1  also wants an exclusive lock on o2, and o2 wants an exclusive lock on o1. Since two processes can’t have an exclusive lock on the same object at the same time, there causes for deadlock.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions