How can your resolve deadlocks?
Answer Posted / ilgian
Deadlocks occour when two or more processes place a lock on
the same resources and each process waits for the others to
release the lock.
The options to avoid deadlocks are basically the following:
1) always update data in the same order: if process A
updates table t1 and then table t2 and process B updates
table t2 and then table t1 deadlocks can occour. Choose an
order and use it everywhere in your code.
2) issue the commands again when you catch the deadlock
3) always update data before data selection: no other
process will place a lock on the modified records
4) identify the processes that can run with lower deadlock
priority and issue SET DEADLOCK_PRIORITY LOW before these
statements: this will tell SQLServer that the process is a
good candidate for killing in case of deadlock, having
the "important" processes free to run without kills
Is This Answer Correct ? | 12 Yes | 0 No |
Post New Answer View All Answers
What are number line correlation administrators will use while working with a subquery?
in a table is b in column k (manikanta,sivananda,muralidhar) i want result like (mnikanta,sivnanda,murlidhar) please slove it
How to include date and time values in sql statements?
What is the purpose of object explorer and its features? : sql server management studio
What does set rowcount do?
Explain what role entity and relationship play in an ER diagram.
What is a result set object returned by odbc_exec()?
Explain magic tables in sql server?
What is the use of builtinadministrators group in sql server? : sql server security
Define Unique Key?
How to concatenate two strings in SQL Server.
How to attach adventureworkslt physical files to the server?
How to execute a sql statement using odbc_exec()?
What is difference between delete & truncate commands?
What are the dmvs?