Deadlock error in high cuncurrency env

  • I am getting error "SQLError: [40001],[Microsoft][SQL Native Client][SQL Server]Transaction (Process ID 64) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."

    Any suggestion to nail down the actual issue and cause of deadlock

  • Read this article to understand the subject:

    Detecting and Ending Deadlocks

    http://msdn.microsoft.com/en-us/library/ms178104.aspx

    However, in many cases, changing the database to read_committed_snapshot will solve your deadlocking problems:

    use master

    alter database [MyDatabase] set allow_snapshot_isolation on

    alter database [MyDatabase] set read_committed_snapshot on

    Before implementing this, you should read about snapshot isolation in SQL Server 2005 Books Online to understand the implications.

    Using Snapshot Isolation:

    http://msdn.microsoft.com/en-us/library/tcbchxcb(VS.80).aspx

  • If possible pls send the dead lock graph. I am currently troubleshooting the same. There are few important this which are not so easy to know. I will be able to tell you what is going wrong.

    You need to first understand why its happening and then look for solution.

    cheers

    Siddarth

  • Use the profiler with the event selected as deadlock graph alone.

    run the profiler and your application instances.once the deadlock occurs the graph will be displayed.from that You can easily identify which is causing the deadlock.then you can tune it.

  • Thanks for response.

    I am not sure how the deadlock graph look like. Is it deadlock.trc files?

  • In the profile, searc for text <deadlock-List>. In the row, rt click -->Extract Event Data> and save the file. Attach the file here.

    cheers

    Siddarth

  • go thru this article.

    msdn.microsoft.com/en-us/library/ms188246.aspx

    You will find that analysing deadlocks is a piece of cake.:-)

  • http://www.mssqltips.com/tip.asp?tip=1234, this would also help.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply