FIX: Insert/Select/(NOLOCK) w/ Rollback May Cause Error 3307

Last reviewed: June 2, 1997
Article ID: Q149243

The information in this article applies to:
  • Microsoft SQL Server, version 6.0
BUG#: 13733 (6.00)

SYMPTOMS

If 'Insert table select * from table (NOLOCK)' is called within a transaction, and this transaction is rolled back afterward, error 3307 might be seen on both the client side and the SQL Server errorlog:

   Process %d was expected to hold logical lock on page %d. Error while
   undoing log row in database '%s'. Rid pageid is %d and row number is
   %d. The SQL Server is terminating this process.

CAUSE

Limited testing has shown that there is a narrow scope in which this problem is encountered:

  1. Select statement has to use (NOLOCK) option.
2. Table has to have nonclustered index. 3. Transaction has to be rolled back.

The page number contained in error 3307 is always the leaf level page of the nonclustered index.

WORKAROUND

  1. Do not use (NOLOCK) in the select statement.
2. Use clustered instead of nonclustered index. 3. Do not put this insert statement in transaction.

STATUS

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


Additional query words: sql6
Keywords : kbbug6.00 kbprg SSrvProg
Version : 6.0
Platform : WINDOWS


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: June 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.