FIX: DYNAMIC Cursor Fails to Release Sh_Page Lock (159042)



The information in this article applies to:

  • Microsoft SQL Server 6.5
  • Microsoft Open Database Connectivity 2.5

This article was previously published under Q159042
BUG #: 16185 (SQLBUG_65)

SYMPTOMS

A DYNAMIC cursor may fail to release sh_page lock after sp_cursorclose if both of the following conditions are true:
  • SET IMPLICIT_TRANSACTIONS ON is used.

    -and-
  • The cursor keeps fetching data backward until there is no data found.
An Open Database Connectivity (ODBC) application may encounter this problem when using a server side DYNAMIC cursor with the SQL_AUTOCOMMIT_OFF option. This problem will occur if the ODBC application uses this cursor to keep fetching data backward until there is no data found.

WORKAROUND

To work around this problem, do one of the following:
  • Use SET IMPLICIT_TRANSACTIONS OFF.

    -or-
  • Change to the cursor to a SCROLL cursor.

    -or-
  • Fetch forward rather than backward.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 6.5 and Open Database Connectivity versions 2.5 and 2.65. This problem has been corrected in U.S. Service Pack 5a for Microsoft SQL Server 6.5 and Open Database Connectivity versions 2.5 and 2.65. For information about how to download and install the latest SQL Server Service Pack, see the following Microsoft Web site: For more information, contact your primary support provider.

MORE INFORMATION

ODBC connections use SET IMPLICIT_TRANSACTIONS ON by default; DB-Library connections do not. Therefore, you are more likely to run into this problem when using an ODBC connection.

Modification Type:MajorLast Reviewed:7/19/2006
Keywords:kbBug kbfix kbinterop kbother KB159042