Here is the exception I am getting, any idea why this might be happening:
Exception: ThisMethod is done: let this go: Exception:
Transaction (Process ID 74) was deadlocked on lock |
communication buffer resources with another process and has been chosen as the deadlock victim.
Rerun the transaction.Stack Trace:at
Jim,Please check the following article for some insight:
http://support.microsoft.com/kb/224453|||
deadlock is a contention by two process on a resource
in a deadlock situtation one is choose as a deadlock victim and are rolled back
and the other rolls forward
you just ave to rerun the deadlock victim
|||
Thanks for the reply.
While users are working in the user interface I am inserting data to the table with another that is back end for the user interface. Although we do insert and update I do not think that user are dealing with the same data row, so I am assuming I should not be receiving deadlock. Does SQL server do RowLock or TableLock. How can I get my insert and update work on the RowLock. Can you give me sample sql statement.
|||sqlserver will escalate the lock (from row/page to table) as it seesfit. While deadlock is not desired, it's necessary in order to allow
the system to proceed forward. Imagine a case where the system just
sits in blocking/contention. That would not be good for either user,
would it. So, the best you can do is to follow the recommendations in
the KB I've posted.
Here is some info on sqlserver locking:
http://msdn2.microsoft.com/en-us/library/ms190615.aspx
And some example of implementing rowlock (again, sql can escalate the lock if it wants to):
http://groups.google.com/groups?q=sqlserver+oj+rowlock+update
No comments:
Post a Comment