February 2, 2011 at 5:53 am
I want to Insert and update same DB table from multiple connections.
When i try to do this, i am getting following errors.
1. "Transaction (Process ID 66) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Return the Transaction"
2. "Transaction (Process ID 58) was deadlocked on lock 1 communication buffer resources with another process and has been chosen as the deadlock victim. Return the Transaction"
3. "Transaction (Process ID 72) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Return the Transaction"
I tried with ROW Lock. didn't get any solution for the same.
Please guide me to resolve this.
February 2, 2011 at 6:56 am
Balaji M R (2/2/2011)
I want to Insert and update same DB table from multiple connections.When i try to do this, i am getting following errors.
1. "Transaction (Process ID 66) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Return the Transaction"
2. "Transaction (Process ID 58) was deadlocked on lock 1 communication buffer resources with another process and has been chosen as the deadlock victim. Return the Transaction"
3. "Transaction (Process ID 72) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Return the Transaction"
I tried with ROW Lock. didn't get any solution for the same.
Please guide me to resolve this.
First off, putting locking hints into your queries should be an absolute last resort option. Same thing with any query hints.
Second, without the deadlock graph and the code, it's hard to know what the problem is. Have you got TRACEFLAG 1222 enabled? If not, I'd start there. Once you can get the information on the deadlock, you'll know more to fix it.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply