How to deliberately cause a deadlock?

前端 未结 2 1300
死守一世寂寞
死守一世寂寞 2020-12-30 05:56

So I\'m trying to track down what looks like a deadlock problem here. I\'ve enabled deadlock logging using DBCC TRACEON(1222,-1) and DBCC TRACEON(1204 ,-1). I\'d like to t

2条回答
  •  Happy的楠姐
    2020-12-30 06:28

    This should work:

    • Insert two records, A and B.
    • Open two transactions.
    • Update record A in the first transaction and B in the second transaction.
    • When you know for sure those updates are done:
      • Update record B in the first transaction and A in the second transaction.

提交回复
热议问题