Microsoft KB Archive/166233

= BUG: Unhandled Exception in SQL Server Using Keyset Cursors =

Article ID: 166233

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q166233



BUG #: 16560 (SQLBUG_65)



SYMPTOMS
SQL Server seems to stop responding and becomes unresponsive when running cursor queries that require keyset cursors. The error log indicates an access violation (AV) and the following error:

closetable: table already closed for sdes '%*.d'

There is no message in the error log about SQL Server being shut down. The client receives the following error:

Error 10037 Unexpected EOF from SQL Server. Connection broken.



CAUSE
SQL Server 6.5 introduced the asynchronous generation of keysets for keyset cursors, using "subprocess." The optimizer decides the number of records in the result set based on the statistics information, and if this number is within the cursor threshold, the keyset values are generated synchronously. When this number exceeds the "cursor threshold" setting, it uses asynchronous generation of keysets by forking a "subprocess" to populate the keyset cursor. When the subprocess completes, it closes itself and while doing so, it generates an access violation that is not completely handled.



WORKAROUND
To work around this problem, either set the cursor threshold configuration parameter to a higher value, or set it to the default setting of -1 (all cursors will be generated synchronously). Also, running UPDATE STATISTICS to have latest distribution information may help the optimizer determine the result set more accurately.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 6.5.

Additional query words: errorlog sync synch async asynch hang hangs hung GPF terminate die freeze lock

Keywords: kbbug kbpending KB166233

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.