FIX: Fetching from an Asynchronous Cursor May Stop SQL Server

ID: Q193454


The information in this article applies to:

BUG #: 18149 (SQLBUG_65)

SYMPTOMS

When SQL Server executes a transaction that contains a cursor, the transaction may stop responding in the COMMIT TRANSACTION. Or, if there is a ROLLBACK TRANSACTION, you may receive the following error:

3307 Process %d was expected to hold logical lock on page %Id.
If this process is killed or if the same transaction is executed again, SQL Server stops responding and must be restarted.

NOTE: This problem only occurs if both of the following conditions are true:


CAUSE

This problem occurs when SQL Server has finished using the asynchronous cursor involved in the transaction. Under a certain condition where the data distribution page's statistics are wrong on the underlying table that the cursor is accessing, SQL Server closes the child thread in the asynchronous cursor before the parent thread is ready, and SQL Server then tries to close the child thread again. This causes SQL Server to stop as it tries to deallocate a non-existing child thread.


WORKAROUND

To work around this problem and prevent it from occurring, you can do either of the following:


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5. This problem has been corrected in U.S. Service Pack 5a for Microsoft SQL Server version 6.5. For information about downloading and installing the latest SQL Server Service Pack, see http://support.microsoft.com/support/sql/.

For more information, contact your primary support provider.

Additional query words: prodsqlsp sp5hang hangs hung tran terminated


Keywords          : kbbug6.50 kbfix6.50.SP5 
Version           : winnt:6.5
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: May 4, 1999