Lock Question - When is an Update (U) lock issued?

Posted by Randy Minder on Stack Overflow See other posts from Stack Overflow or by Randy Minder
Published on 2010-05-11T15:54:53Z Indexed on 2010/05/11 16:04 UTC
Read the original article Hit count: 260

Filed under:

We are trying to resolve a deadlock problem. The transaction that is getting rolled back is attempting to issue an Update (U) lock on a resource that another transaction has an Exclusive (X) lock on. According to Books Online (http://msdn.microsoft.com/en-us/library/ms175519.aspx), an Update lock is supposed to prevent deadlocks, not cause them.

So, my question is, why/when is an Update lock applied to a resource? We're a little confused about this because the resource that is attempting to have the Update lock applied to will not be updated by the process that is having the transaction rolled back.

Thanks for your help on this.

Randy

© Stack Overflow or respective owner

Related posts about sql-server