FIX: Err 1203 Running Dynamic Cursor in a Stored Procedure

ID: Q165512


The information in this article applies to:

BUG #: 16523

SYMPTOMS

A cursor that is retrieving data from within a stored procedure may fail with error 1203 "Caller of lock manager is incorrectly trying to unlock an unlocked object. Spid=%d locktype=%d dbid=%d lockid=%id". This error may happen a few times, or it may go into an endless loop in the errorlog, quickly filling up the disk it resides on. This problem only occurs on SQL Server version 6.5 Service Pack 2.


CAUSE

The problem occurs when SQL Server upgrades a page lock to a table lock. The dynamic cursor's connection is not informed of the lock escalation, and repeatedly tries to unlock the page lock.


WORKAROUND

To work around this problem, change the cursor from a dynamic cursor to a SCROLL cursor by adding the keyword SCROLL to the cursor create.


STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5 Service Pack 2. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.


Keywords          : kbusage SSrvGen SSrvLock kbbug6.50.sp2 
Version           : 6.5 sp2
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: April 9, 1999