16 April 2015

Reducing or Minimizing Deadlocks

Anyway deadlocks cannot be avoid completely, following steps are useful to minimize the chance of generating a deadlock. If deadlocks are less automatically increase transaction throughput and reduce system overhead.
Small transactions are

  • Rolled back, undoing all the work performed by the transaction.
  • Resubmitted by applications because they were rolled back when deadlocked.

Steps to reducing deadlocks:

  1. Access the objects in the same order
  2. Avoid user interaction with in the transactions
  3. Always keep transactions are short and in one batch
  4. Better to use a lower isolation level.
  5. Use snapshot isolation.
  6. Use bound connections.
  7. Better to use a row versioning-type isolation level
  8. Set READ_COMMITTED_SNAPSHOT database option ON to enable read-committed transactions to use row versioning.
-- By Shivasagar V

No comments:

Post a Comment