FIX: Descending Index Scans May Block with High Transaction Isolation

Article translations Article translations
Article ID: 196919 - View products that this article applies to.
This article was previously published under Q196919
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 52498
Expand all | Collapse all

SYMPTOMS

A descending index scan with a SERIALIZABLE transaction isolation level or a HOLDLOCK hint can hold a lock that prevents inserts greater than the highest value current in the table for the index the scan is performed on.

WORKAROUND

To work around this problem, do not use descending index scans when using a SERIALIZABLE transaction isolation level or a HOLDLOCK hint.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 1 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
232570INF: How to Obtain Service Pack 1 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.

MORE INFORMATION

The following example queries clarify this problem:

--query 1:
   create table t(x int primary key)
   insert into t values(0)
   insert into t values(2)
   insert into t values(3)
   insert into t values(4)
   insert into t values(6)
   go
   set transaction isolation level serializable
   begin transaction
   go
   select * from t where x < 3 order by x desc
   go
					
--query 2: Run from another connection
   insert into t values(1) -- blocked as expected
   go
					
--query 3: Run from another connection
   insert into t values(5) -- works
   go
   insert into t values(7) -- blocked until query 1 client releases locks
   go
					
The following is the problem lock as reported by the sp_lock stored procedure:


   spid   dbid   ObjId       IndId  Type Resource         Mode     Status
   ------ ------ ----------- ------ ---- ---------------- -------- ------

   7      5      1365579903  1      KEY  (ffffffffffff)   IS-S     GRANT
				

Properties

Article ID: 196919 - Last Review: October 11, 2013 - Revision: 2.1
APPLIES TO
  • Microsoft SQL Server 7.0 Standard Edition
Keywords: 
kbnosurvey kbarchive kbbug kbfix kbsqlserv700sp1fix KB196919

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com