troubleshooting Question

Transaction deadlocked

Avatar of BlearyEye
BlearyEyeFlag for United States of America asked on
Microsoft SQL ServerASP.NETMicrosoft SQL Server 2008
9 Comments2 Solutions2109 ViewsLast Modified:
I'm using CS 4.0. I'm getting an SQL exception: "Transaction (process ID 56) was deadlocked on lock | generic waitable object resources with another process and has been chosen as the deadlock victim. Rerun the transaction."

The query being executed is
UPDATE PatientProtocols
SET
	LockProcessGuid = @LockProcessGuid,
	LockInstanceNumber = @LockInstanceNumber
WHERE	PatientProtocolId = @PatientProtocolId
where the appropriate parameters have been passed in.

When the exception occurs, I can try to run the update from MSSMS. When I do, it does not terminate; I have to stop it.

My guess is that either the table or a record is being locked. It does not seem to depend on the values of the parameters, so probably the table. I've tried running
SELECT * FROM sys.dm_tran_locks
but am not sure what the results mean.

Advice?
ASKER CERTIFIED SOLUTION
Daniel_PL
DB Expert/Architect
Join our community to see this answer!
Unlock 2 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros