What is deadlock and how to avoid the deadlocks.

Answer Posted / dba

P1 has lock on R1
P2 has lock on R2
P1 requests lock on R2
P2 Requests lock on R1

Where P & R are corresponding processes and resources.

Deadlock consists of two processes requesting locks on
resources thus, blocking each other.

You can avoid Deadlocks:
Access objects in the same order
Use lower isolation levels
Keep Transactions short and in one batch
Avoid user interactions in transaction
Use bound connections

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you pass expressions to stored procedure parameters?

586


how can a database be repaired? : Sql server administration

584


Explain in brief about Microsoft SQL server?

636


What is sql server transaction log file?

595


What is precedence constraint?

630






What are the various Operating system files that every SQL server 2005 database has and what is the purpose.

699


How do you know if sql server is running on your local system?

628


What are the differences between “row_number()”, “rank()” and “dense_rank()”?

614


What is the difference between nvl and nvl2?

629


How to delete a login name in ms sql server?

625


Can we insert data into view sql server?

616


How to drop existing indexes in ms sql server?

685


How do you rename a table in sql server?

568


Explain sub-query?

649


What do you mean by tablesample?

734