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 the different authentication modes in sql server? How can it be changed?
Explain trigger and its types?
How do we know if any query is retrieving a large amount of data or very little data?
What is the downside of using udf?
explain declarative management framework (dmf) in sql server 2008?
What is 4nf in normalization form?
Does transparent data encryption provide encryption when transmitting data across the network?
How connect excel to sql server?
what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration
How to find related tables in sql server?
Explain sql server authentication modes?
What is the difference between a check constraint and a rule?
what is the Ticketing tool used in Wipro technologies at Bangalore...???
How to create function without parameter in sql server?
Why is there a performance difference between two similar queries where one uses union and the other uses union all?