Skip to main content

I useam using MS SQL-SQL 2008 and for coding witham using C# in a web project. Currently

Currently, I got stuck with sql deadlock. I

I have 2 transactiontransactions, one of two is a long transaction. When

When both transactiontransactions run simultaneously, deadlock occurs and short transaction will be chose to be killed automatically. My

My Current solution, I catcham catching the exception of deadlock and redo the short transaction, it run well, just take some time. But

But, I wonder that if there is any solution to avoid deadlock from the root cause?

I use MS SQL 2008 and coding with C# in a web project. Currently, I got stuck with sql deadlock. I have 2 transaction, one of two is a long transaction. When both transaction run simultaneously, deadlock occurs and short transaction will be chose to be killed automatically. My Current solution, I catch the exception of deadlock and redo the short transaction, it run well, just take some time. But, I wonder that if there is any solution to avoid deadlock from the root cause?

I am using MS-SQL 2008 and for coding am using C# in a web project.

Currently, I got stuck with sql deadlock.

I have 2 transactions, one of two is a long transaction.

When both transactions run simultaneously, deadlock occurs and short transaction will be chose to be killed automatically.

My Current solution, I am catching the exception of deadlock and redo the short transaction, it run well, just take some time.

But, I wonder that if there is any solution to avoid deadlock from the root cause?

edited tags
Link
Clemens
  • 129.1k
  • 13
  • 163
  • 296
Source Link
kidgu
  • 413
  • 1
  • 8
  • 18

How to avoid sql deadlock?

I use MS SQL 2008 and coding with C# in a web project. Currently, I got stuck with sql deadlock. I have 2 transaction, one of two is a long transaction. When both transaction run simultaneously, deadlock occurs and short transaction will be chose to be killed automatically. My Current solution, I catch the exception of deadlock and redo the short transaction, it run well, just take some time. But, I wonder that if there is any solution to avoid deadlock from the root cause?