FIX: Invalid Text Handle Errors May Occur in Transactions

Last reviewed: June 27, 1997
Article ID: Q167335
The information in this article applies to:
  • Microsoft SQL Server, version 6.5
BUG #: 16426

SYMPTOMS

Even if you have the lock isolation level set to HOLDLOCK or REPEATABLE READ, a text pointer can be changed while you are in a transaction. This will result in an invalid text handle when you try to use it again.

For example, during the WAITFOR delay in the following query, another user can update the @mytextptr before you can use it, resulting in an invalid textpointer error:

   BEGIN TRAN
   declare @mytextptr varbinary(16)
   select @mytextptr=TEXTPTR(pr_info)
      from pub_info where pub_id='9999' and
   TEXTVALID('pub_info.pr_info',TEXTPTR(pr_info))=1
   WAITFOR DELAY "00:00:10"
   IF @mytextptr IS NOT NULL
      WRITETEXT  pub_info.pr_info @mytextptr WITH LOG 'Hello Again'
   COMMIT TRAN

WORKAROUND

Use the locking hint UPDLOCK, which causes the textpointer to be correctly held. For example:

   select @mytextptr=TEXTPTR(pr_info)
      from pub_info (UPDLOCK) where pub_id='9999' and
   TEXTVALID('pub_info.pr_info',TEXTPTR(pr_info))=1

STATUS

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


Keywords : kbbug6.50 kbusage SSrvGen SSrvLock
Version : 6.5
Platform : WINDOWS
Issue type : kbbug
Resolution 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: June 27, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.