Article ID: 236955 - View products that this article applies to.
This article was previously published under Q236955
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 56013 (SQLBUG_70)
Lock conversion is the process of upgrading a lock to provide an enhanced control over a resource. For example, you set the transaction isolation level to serializable and then perform a select followed by an update of the same row in which a conversion from a shared lock to an exclusive lock is performed. Lock conversions are commonly encountered when using repeatable read or serializable locking isolation levels, but are not limited to these isolation levels. The following example shows the conversion from an IS-S to and IS-X to accommodate the conversion.
When working with multiple connections, which attempt to access the same lock resource, it is possible to get a standard blocking scenario. The following example is a simple block showing the sysprocesses blocked indication and the corresponding WAIT from sp_lock.
When SPID 7 is done with the lock it will GRANT SPID 9 the lock and allow SPID 9 to run.
For these conditions, refer to the following article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/162361/EN-US/ )INF: Understanding and Resolving SQL Server Blocking Problems
However, under some circumstances the lock conversion process does GRANT the lock to a waiting SPID but does not properly allow the SPID to execute. You may see the following output under these conditions:
SPID 7 completed use of the lock resource that SPID 9 was waiting on. SPID 7 then GRANTed the lock to SPID 9 but did not clear the waittype and waitresource for SPID 9, leaving it in the sleeping state.
The nature of this problem is such that the SPID is actually granted the lock but the SPID remains in a sleeping state with a lock waittype. (Lock mode waittypes would include, but may not be limited to, those waittypes of 0x1 to 0xF.)
When in this state, closing the client application connection or using the T-SQL KILL command rolls back the transaction and allows the server to continue normal processing.
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
254561For more information, contact your primary support provider.
(http://support.microsoft.com/kb/254561/ )INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
Applications written to use Microsoft Transaction Server (MTS) components with transactional support provided by the Microsoft Distribution Transaction Coordinator (DTC) may be more susceptible to the problem. The default isolation level used by the MTS/DTC combination is serializable.