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

Answer Posted / kkkkkk

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 processDeak Lock is a situation when two or more process
continuous working and each having a lock on a particular
record but at a time only one can lock a particular and the
other one will go to dead lock.

A livelock is one, where a request for an exclusive lock
is repeatedly denied because a series of overlapping shared
locks keeps interfering. SQL Server detects the situation
after four denials and refuses further shared locks. A
livelock also occurs when read transactions monopolize a
table or page, forcing a write transaction to wait
indefinitely.A human example of live lock would be two people who meet
face-to-face in a corridor and each moves 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.

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are .mdf files?

518


How do I install sql server?

460


How to resolve the orphan use problem? : sql server security

525


Is natural join and equi join same?

523


What is difference between rownum and rowid?

505






What are three major types of constraints?

516


What is the use of tempdb? What values does it hold?

563


What are sql server procedures?

541


How to add an address record into adventureworkslt?

565


Explain cursor as data base object?

574


what are questions asked in TCS for database tester (sqlserver)for 2-3 exp?

5495


What is pessimistic concurrency?

540


How do indexes help, types?

548


Can the “if update (colname)” statement be used in a delete trigger?

552


Do you know what are different types of replication in sql server?

508