Hi
What is the Deadlock and Live Lock in SQL Server. How will you go about the Resolving Deadlocks ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Apr 22, 2012, 11:58 PM
Deadlock occurs when two users have locks on separate objects and each user wants a lock on the other's object. When this happens, SQL Server ends the deadlock by automatically choosing one and aborting the process, allowing the other process to continue.
For live lock please refer,
http://blog.sqlauthority.com/2008/03/21/sql-server-introduction-to-live-lock-what-is-live-lock/
To avoide Deadlocks
- Minimize the size and time of transaction.
- use nolock and rowlock with query if possible
select * from table1 (nolock)
- Select deadlock victim by using SET DEADLOCK_PRIORITY.
hope this help.
SenthilkumarPosted Apr 20, 2012, 2:08 AM
For more info:
http://dba.fyicenter.com/Interview-Questions/SQL-Server-DBA/What_is_a_deadlock_and_what_is_a_live_lock_How_.html