question

ramesh 1 avatar image
ramesh 1 asked

sql server 2005 exception

hi team, i can find this exception while access my web based application, can you please help me ** Transaction (Process ID) was deadlocked on resources with another process and has been chosen as the deadlock victim. Rerun the transaction.**
sql-server-2005deadlock
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

WilliamD avatar image
WilliamD answered
You had two (or more) transactions that were waiting on each other to finish their work before they could continue. This is a race condition that cannot solve itself, so SQL Server stepped in and kicked one of the transactions/processes out of the loop. Unfortunately, deadlock information is not captured by the default trace. This is something that needs to be setup in an extra trace, or log. Take a look at the blog posts on [MSDN from Bart Duncan][1] (three parts, all linked together) to see how it all works. [1]: http://blogs.msdn.com/b/bartd/archive/2006/09/09/747119.aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ThomasRushton avatar image
ThomasRushton answered
Deadlock issues may arise due to sub-optimal application design. Consider a situation such as: - Process A begins a transaction - Process B begins a transaction - Process A starts updating table X - Process B starts updating table Y - Process A tries to update table Y but can't, because of Process B - Process B tries to update table X but can't, because of Process A Both these processes are blocking each other - deadlock. SQL Server picks one at random and kills it, allowing the other to proceed. Typical causes of this are applications being a bit too free with the order in which they update dependent tables - are there guidelines (or rules, even) in place for the development team giving an order in which these things should be done?
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.