3
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
4
<!--All rights reserved.-->
5
<!--See the file LICENSE for redistribution information.-->
8
<title>Berkeley DB: Db::set_paniccall</title>
9
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
10
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
13
<a name="2"><!--meow--></a>
14
<table width="100%"><tr valign=top>
16
<h1>Db::set_paniccall</h1>
19
<a href="../api_cxx/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
24
#include <db_cxx.h>
28
void (*db_paniccall_fcn)(DbEnv *dbenv, int errval));
31
<p>Errors can occur in the Berkeley DB library where the only solution is to shut
32
down the application and run recovery (for example, if Berkeley DB is unable
33
to allocate heap memory). In these cases, when the C++ error model has
34
been configured so that the individual Berkeley DB methods return error codes
35
(see <a href="../api_cxx/except_class.html">DbException</a> for more information), the value
36
<a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> is returned by Berkeley DB methods.
37
<p>In these cases, it is also often simpler to shut down the application
38
when such errors occur rather than to try to gracefully return up the
39
stack. The <a href="../api_cxx/env_set_paniccall.html">DbEnv::set_paniccall</a> and Db::set_paniccall methods
40
are used to specify methods to be called when
41
<a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> is about to be returned from a Berkeley DB interface.
42
When called, the <b>dbenv</b> argument will be a reference to the
43
current environment, and the <b>errval</b> argument is the error value
44
that would have been returned to the calling method.
45
<p>For <a href="../api_cxx/db_class.html">Db</a> handles opened inside of Berkeley DB environments, calling the
46
Db::set_paniccall method affects the entire environment and is equivalent to calling
47
the <a href="../api_cxx/env_set_paniccall.html">DbEnv::set_paniccall</a> method.
48
<p>The Db::set_paniccall interface may be called at any time during the life of
50
<p>The Db::set_paniccall method either returns a non-zero error value or throws an exception that
51
encapsulates a non-zero error value on failure, and returns 0 on success.
53
<a href="../api_cxx/db_class.html">Db</a>
55
<a href="../api_cxx/db_list.html">Databases and Related Methods</a>
57
<table width="100%"><tr><td><br></td><td align=right>
58
<a href="../api_cxx/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
60
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>