<!--$Id: env_set_paniccall.so,v 10.37 2004/08/13 03:38:57 bostic Exp $--> <!--Copyright 1997-2004 by Sleepycat Software, Inc.--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> <head> <title>Berkeley DB: DB_ENV->set_paniccall</title> <meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> <meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> </head> <body bgcolor=white> <table width="100%"><tr valign=top> <td> <h3>DB_ENV->set_paniccall</h3> </td> <td align=right> <a href="../../db43-devel-4.3.21/api_c/api_core.html"><img src="../../db43-4.3.21/images/api.gif" alt="API"></a> <a href="../../db43-devel-4.3.21/ref/toc.html"><img src="../../db43-4.3.21/images/ref.gif" alt="Ref"></a></td> </tr></table> <hr size=1 noshade> <tt> <h3><pre> #include <db.h> <p> int DB_ENV->set_paniccall(DB_ENV *dbenv, void (*db_panic_fcn)(DB_ENV *dbenv, int errval)); </pre></h3> <hr size=1 noshade> <h3>Description: DB_ENV->set_paniccall</h3> <p>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 <a href="../../db43-devel-4.3.21/ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>. It is often easier to simply exit the application when such errors occur rather than gracefully return up the stack. The DB_ENV->set_paniccall method specifies a function to be called when <a href="../../db43-devel-4.3.21/ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> is about to be returned from a Berkeley DB method.</p> <p>The DB_ENV->set_paniccall method may be called at any time during the life of the application.</p> <p>The DB_ENV->set_paniccall method returns a non-zero error value on failure and 0 on success. </p> <h3>Parameters</h3> <dl compact> <dt><b>db_panic_fcn</b><dd>The <b>db_panic_fcn</b> parameter is the application-specified function called in the case of a database environment panic. The function takes two arguments: <dl compact> <dt><b>dbenv</b><dd>The <b>dbenv</b> parameter is the enclosing database environment handle. <dt><b>errval</b><dd>The <b>errval</b> parameter is the error value that would have been returned to the caller if <a href="../../db43-devel-4.3.21/ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> were not going to be returned instead. </dl> </dl> <hr size=1 noshade> <h3>Class</h3> <a href="../../db43-devel-4.3.21/api_c/env_class.html">DB_ENV</a> <h3>See Also</h3> <a href="../../db43-devel-4.3.21/api_c/env_list.html">Database Environments and Related Methods</a> </tt> <table width="100%"><tr><td><br></td><td align=right> <a href="../../db43-devel-4.3.21/api_c/api_core.html"><img src="../../db43-4.3.21/images/api.gif" alt="API"></a><a href="../../db43-devel-4.3.21/ref/toc.html"><img src="../../db43-4.3.21/images/ref.gif" alt="Ref"></a> </td></tr></table> <p><font size=1><a href="../../db43-devel-4.3.21/sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> </body> </html>