Short Notes


Deadlocks with Select statements


Recently, a friend of mine called and asked me whether two select statements can cause deadlocks
There are situations where it can happen as even select statement could cause to exclusive locks. I remember we faced this some times during SQL Server 2000 days.  I was under the belief that it doesn't happen anymore.

But she bombarded me with error log entries stating two connections causing deadlocks.  But when I further analyzed, I found that there were select statements issued, when the exclusive locks are already in place.  The deadlock graph does not show the statements which caused the exclusive locks even though the same sessions have caused them. The statements displayed are the ones requesting the incompatible locks.




No comments:

Post a Comment