BUG: Calling dberrhandle in Error Handler Causes Recursion

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 : kbprg SSrvDB_Lib SSrvProg kbbug4.21
Version : 4.21 | 4.21 | 4.21
Platform : MS-DOS OS/2 WINDOWS
Issue type :


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