What is deadlock and how to avoid the deadlocks.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Can you explain different types of locks in sql server?
What stored by the model? : sql server database administration
How do I manually uninstall an instance of sql server 2016?
what is package and it uses and how can u call a package
What are the new data types are introduced in sql 2000?
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 - - - - - - - -
List the various tools available for performance tuning?
What is the difference between functions and stored procedures?
how to find 6th highest salary
What about UPDATESTATISTICS ?
What is the use of floor function in sql server?
What is the system function to get the current user's user id?