What is deadlock and how to avoid the deadlocks.

Answers were Sorted based on User's Feedback



What is deadlock and how to avoid the deadlocks...

Answer / moin

A deadlock occurs when there is a cyclic dependency between
two or more threads for some set of resources.

Is This Answer Correct ?    13 Yes 1 No

What is deadlock and how to avoid the deadlocks...

Answer / 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

What is deadlock and how to avoid the deadlocks...

Answer / raghu

Consider there are transcations going on 1 row, some one is
trying to update a column in that row while others are
trying to retrive data of same row,while update locks the
row for some period of time others cannot select it, hence
deadlock occurs.

To kill the process is solution. In sql server 2005 use sql
profiler to view the process, in that see the column named
transactions if its value is more than 1 right click and
kill the process.

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More SQL Server Interview Questions

Can you explain different types of locks in sql server?

0 Answers  


What stored by the model? : sql server database administration

0 Answers  


How do I manually uninstall an instance of sql server 2016?

0 Answers  


what is package and it uses and how can u call a package

0 Answers   Satyam,


What are the new data types are introduced in sql 2000?

0 Answers  






can any one post me, how to remove rows in the below table ENO ENAME EDEPT ELOC 3368 BPS BI Adayar 3371 RAN BI valachari 3369 SRI BI valachari 3372 jay BI Chn - - - - - - - -

2 Answers  


List the various tools available for performance tuning?

0 Answers  


What is the difference between functions and stored procedures?

0 Answers   Accenture,


how to find 6th highest salary

0 Answers   Chetak Logistics,


What about UPDATESTATISTICS ?

2 Answers   HCL, Intelligroup,


What is the use of floor function in sql server?

0 Answers  


What is the system function to get the current user's user id?

3 Answers   TCS,


Categories