BUG: UPDLOCK Locking Option Sets Only Shared Lock with Sp_cursor

Last reviewed: March 6, 1998
Article ID: Q179222
The information in this article applies to:
  • Microsoft SQL Server version 6.5
BUG #: 16273 (NT: 6.5)

SYMPTOMS

If you open a KEYSET cursor with the locking option UPDLOCK through sp_cursoropen in a transaction, only a shared lock is set on the pages with the qualifying data rows. With the first sp_cursorfetch, an Update_page lock is set.

This leads to a good chance to run into a deadlock.

WORKAROUND

To work around this problem, do either of the following:

  • Use a DYNAMIC or FORWARD-ONLY cursor.

    -or-

  • Use TABLOCK or HOLDLOCK instead of UPDLOCK as optional optimizer hints in the FROM clause.

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5. A supported fix is now available, but has not been fully regression- tested and should be applied only to systems experiencing this specific problem. Unless you are severely impacted by this specific problem, Microsoft recommends that you wait for the next Service Pack that contains this fix. Contact Microsoft Technical Support for more information.


Additional query words: blocking
Keywords : kbbug6.50 SSrvTran_SQL
Version : WINNT:6.5
Platform : winnt
Issue type : kbbug
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 6, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.