0

I have a update query which updates customer status by their unique customer id at several levels of application flow. I have following exception several times in my application logs

Transaction was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

My update query is as follows:

UPDATE customer SET status= ?  WHERE cust_id = ?

I guess it's because of table level locking but i didn't enabled it. My question is does table level locking is enable by default? Will implementing row level locking will help me to resolve this situation? How do i enable row level locking for this query? thanks

Rameez
  • 1,712
  • 2
  • 18
  • 39
  • Capture the deadlock info and post it here (the XML, not the picture!). Follow the steps from [Save Deadlock Graphs](http://technet.microsoft.com/en-us/library/ms190465.aspx) – Remus Rusanu Sep 18 '13 at 11:36
  • http://stackoverflow.com/questions/1038113/how-to-find-current-transaction-level – vasja Sep 18 '13 at 11:39

1 Answers1

0

This may be too late, but here goes nothing.

Table level locking is the default in sql server. Row level locking would be helpful in your case, but if the the system gets low on available resources it transfers to table level locking, which might lead to problems for you.

Shubham Pandey
  • 919
  • 1
  • 9
  • 19