DB->set_paniccall |
#include <db.h>int DB->set_paniccall(DB *db, void (*db_panic_fcn)(DB_ENV *dbenv, int errval));
Errors can occur in the Berkeley DB library where the only solution is to shut down the application and run recovery (for example, if Berkeley DB is unable to allocate heap memory). In such cases, the Berkeley DB methods will return DB_RUNRECOVERY. It is often easier to simply exit the application when such errors occur rather than gracefully return up the stack. The DB->set_paniccall method specifies a function to be called when DB_RUNRECOVERY is about to be returned from a Berkeley DB method.
For DB handles opened inside of Berkeley DB environments, calling the DB->set_paniccall method affects the entire environment and is equivalent to calling the DB_ENV->set_paniccall method.
The DB->set_paniccall method may be called at any time during the life of the application.
The DB->set_paniccall method returns a non-zero error value on failure and 0 on success.
Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.