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 |
Explain what are the restrictions that views have to follow? : SQL Server Architecture
can we have a nested transaction? : Sql server database administration
How to download and install microsoft sql server management studio express?
What is the appropriate number of test cases that you can write on a database?
What is the significance of master, tempdb and model databases?
You want to check the syntax of a complicated update sql statement without executing it. What command should you use?
1.what is the difference between view and cursor? 2.If we do any change in view will it affect the database,similarly when we do changes in cursor will it affect the databse?with certain example?Thanks
Explain nested stored procedure. Syntax and an example for create nested stored procedure?
What is cdc in sql server?
What are “phantom rows”?
can foreign key take role of primary key?
5 Answers CarrizalSoft Technologies, TCS, Villa Marie,
What samples and sample databases are provided by microsoft?