Search code examples
c#.netsqldatabase-deadlocksdatabase-concurrency

Deadlock help needed please


I have a peculiar situation. I have tables that are constantly accessed by different parts of our code and thousands of clients and so we employed the use of transactions when doing simple updates and inserts on our tables. Problem is we keep getting deadlock errors. Anyone have any idea how I can alleviate this problem?


Solution

  • Deadlocks can arise for many reasons and combinations thereof:

    • Poor schema design

    • Incorrect indexes for your query workload

    • Poorly written TSQL

    • Aggressive transaction isolation levels and/or long running open transactions

    • Poor application access patterns

    • Low spec or incorrectly configured hardware

    All of these are common.

    I suggest you read