1
<!--$Id: env_set_tx_recover.so,v 10.30 2001/05/15 14:44:12 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB: DbEnv::set_tx_recover</title>
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
11
<a name="2"><!--meow--></a>
12
<table width="100%"><tr valign=top>
14
<h1>DbEnv::set_tx_recover</h1>
17
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
22
#include <db_cxx.h>
25
DbEnv::set_tx_recover(int (*)(DbEnv *dbenv,
26
Dbt *log_rec, DbLsn *lsn, db_recops op));
29
<p>Set the application's method to be called during transaction abort
30
and recovery. This method must return 0 on success and either
31
<b>errno</b> or a value outside of the Berkeley DB error name space on
32
failure. It takes four arguments:
34
<p><dt>dbenv <dd>A Berkeley DB environment.
35
<p><dt>log_rec<dd>A log record.
36
<p><dt>lsn<dd>A log sequence number.
37
<p><dt>op<dd>One of the following values:
39
<p><dt><a name="DB_TXN_BACKWARD_ROLL">DB_TXN_BACKWARD_ROLL</a><dd>The log is being read backward to determine which transactions have been
40
committed and to abort those operations that were not; undo the operation
41
described by the log record.
42
<p><dt><a name="DB_TXN_FORWARD_ROLL">DB_TXN_FORWARD_ROLL</a><dd>The log is being played forward; redo the operation described by the log
44
<p><dt><a name="DB_TXN_ABORT">DB_TXN_ABORT</a><dd>The log is being read backward during a transaction abort; undo the
45
operation described by the log record.
48
<p>The DbEnv::set_tx_recover interface may be used only to configure Berkeley DB before
49
the <a href="../api_cxx/env_open.html">DbEnv::open</a> interface is called.
50
<p>The DbEnv::set_tx_recover 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
<p>The DbEnv::set_tx_recover method may fail and throw an exception or return a non-zero error for the following conditions:
55
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
56
<p>Called after <a href="../api_cxx/env_open.html">DbEnv::open</a> was called.
58
<p>The DbEnv::set_tx_recover method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods.
59
If a catastrophic error has occurred, the DbEnv::set_tx_recover method may fail and either
60
return <a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> or throw an exception encapsulating
61
<a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>, in which case all subsequent Berkeley DB calls will fail
64
<a href="../api_cxx/dbenv_class.html">DbEnv</a>, <a href="../api_cxx/txn_class.html">DbTxn</a>
66
<a href="../api_cxx/env_set_tx_max.html">DbEnv::set_tx_max</a>,
67
<a href="../api_cxx/env_set_tx_recover.html">DbEnv::set_tx_recover</a>,
68
<a href="../api_cxx/env_set_tx_timestamp.html">DbEnv::set_tx_timestamp</a>,
69
<a href="../api_cxx/txn_abort.html">DbTxn::abort</a>,
70
<a href="../api_cxx/txn_begin.html">DbEnv::txn_begin</a>,
71
<a href="../api_cxx/txn_checkpoint.html">DbEnv::txn_checkpoint</a>,
72
<a href="../api_cxx/txn_commit.html">DbTxn::commit</a>,
73
<a href="../api_cxx/txn_discard.html">DbTxn::discard</a>,
74
<a href="../api_cxx/txn_id.html">DbTxn::id</a>,
75
<a href="../api_cxx/txn_prepare.html">DbTxn::prepare</a>,
76
<a href="../api_cxx/txn_recover.html">DbEnv::txn_recover</a>,
78
<a href="../api_cxx/txn_stat.html">DbEnv::txn_stat</a>.
80
<table width="100%"><tr><td><br></td><td align=right>
81
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
83
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>