BUG: Calling dberrhandle in Error Handler Causes Recursion

Last reviewed: April 29, 1997
Article ID: Q113527

The information in this article applies to:
  • Microsoft SQL Server Programmer's Toolkit, version 4.2
BUG# 9907 (4.21)

SYMPTOMS

After receiving an error fatal to a dbprocess, such as a 10025 "Write to SQL Server Failed," a continual stream of 10005 "DBPROCESS is dead or not enabled" errors is received by the error handler.

CAUSE

Calling dberrhandle(NULL) inside of the DB-Library (DB-Lib) error handler, when it is called due to a dbprocess killing error, like 10025 or 10005, will cause the error handler to be called again with a 10005 error.

WORKAROUND

Applications should call dberrhandle() within their error handlers only if the following condition is true:

   dbproc != NULL && !DBDEAD( dbproc )

This behavior does not occur in versions of DB-Library prior to version 4.21.

STATUS

Microsoft has confirmed this to be a problem in DB-Library version 4.21. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

This problem will generally cause the error handler to receive one 10025 error, followed by an endless stream of 10005 errors.

For example:

   int err_handler( ... )
   {
        dberrhandle( NULL );

        // .. process error

        dberrhandle( err_handler );
   }

On OS/2, the error handler is not called endlessly, but the DB-Library call that caused the initial error to be generated is never returned from.


Additional query words: dbgetuserdata handling handle msg dblib
Keywords : kbbug4.21 kbprg SSrvDB_Lib SSrvProg
Version : 4.21 | 4.21 | 4.21
Platform : MS-DOS OS/2 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: April 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.