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

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 : kbprg SSrvProg kbbug6.00
Version : 6.0
Platform : WINDOWS
Issue type :


Last Reviewed: March 24, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.