1
<!--$Id: txn_recover.so,v 10.7 2001/07/11 14:22:31 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB: DbEnv.txn_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.txn_recover</h1>
17
<a href="../api_java/java_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
22
import com.sleepycat.db.*;
24
public DbPreplist[] txn_recover(int count, int flags)
28
<p>The DbEnv.txn_recover interface returns a list of prepared but not
29
yet resolved transactions. The DbEnv.txn_recover method should only be
30
called after the environment has been recovered. Because database
31
environment state must be preserved between recovery and the application
32
calling DbEnv.txn_recover, applications must either call
33
DbEnv.txn_recover using the same environment handle used when recovery
34
is done, or the database environment must not be configured using the
35
<a href="../api_java/env_open.html#DB_PRIVATE">Db.DB_PRIVATE</a> flag.
36
<p>The DbEnv.txn_recover method returns a list of transactions that must be
37
resolved by the application (committed, aborted or discarded). The
38
return value is an array of objects of type DbPreplist; the following
39
DbPreplist fields will be filled in:
41
<p><dt>public DbTxn txn;<dd>The transaction handle for the transaction.
42
<p><dt>public byte[] gid;<dd>The global transaction ID for the transaction. The global transaction
43
ID is the one specified when the transaction was prepared. The
44
application is responsible for ensuring uniqueness among global
47
<p>The application must call <a href="../api_java/txn_abort.html">DbTxn.abort</a>, <a href="../api_java/txn_commit.html">DbTxn.commit</a> or
48
<a href="../api_java/txn_discard.html">DbTxn.discard</a> on each returned <a href="../api_java/txn_class.html">DbTxn</a> handle before
49
starting any new operations.
50
<p>The <b>count</b> parameter specifies the number of maximum size of the
51
array that should be returned.
52
<p>The <b>flags</b> value must be set to one of the following values:
54
<p><dt><a name="Db.DB_FIRST">Db.DB_FIRST</a><dd>Begin returning a list of prepared, but not yet resolved transactions.
55
<p><dt><a name="Db.DB_NEXT">Db.DB_NEXT</a><dd>Continue returning a list of prepared, but not yet resolved transactions,
56
starting where the last call to DbEnv.txn_recover left off.
58
<p>The DbEnv.txn_recover method throws an exception that encapsulates a non-zero error value on
61
<p>The DbEnv.txn_recover method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods.
62
If a catastrophic error has occurred, the DbEnv.txn_recover method may fail and throw
63
a <a href="../api_java/runrec_class.html">DbRunRecoveryException</a>, in which case all subsequent Berkeley DB calls
64
will fail in the same way.
66
<a href="../api_java/dbenv_class.html">DbEnv</a>, <a href="../api_java/txn_class.html">DbTxn</a>
68
<a href="../api_java/env_set_tx_max.html">DbEnv.set_tx_max</a>,
69
<a href="../api_java/env_set_tx_timestamp.html">DbEnv.set_tx_timestamp</a>,
70
<a href="../api_java/txn_abort.html">DbTxn.abort</a>,
71
<a href="../api_java/txn_begin.html">DbEnv.txn_begin</a>,
72
<a href="../api_java/txn_checkpoint.html">DbEnv.txn_checkpoint</a>,
73
<a href="../api_java/txn_commit.html">DbTxn.commit</a>,
74
<a href="../api_java/txn_discard.html">DbTxn.discard</a>,
75
<a href="../api_java/txn_id.html">DbTxn.id</a>,
76
<a href="../api_java/txn_prepare.html">DbTxn.prepare</a>,
77
<a href="../api_java/txn_recover.html">DbEnv.txn_recover</a>,
79
<a href="../api_java/txn_stat.html">DbEnv.txn_stat</a>.
81
<table width="100%"><tr><td><br></td><td align=right>
82
<a href="../api_java/java_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
84
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>