<!--$Id: txn_recover.html,v 1.2 2004/03/30 01:21:42 jtownsen Exp $--> <!--Copyright 1997-2003 by Sleepycat Software, Inc.--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> <head> <title>Berkeley DB: DB_ENV->txn_recover</title> <meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> <meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> </head> <body bgcolor=white> <a name="2"><!--meow--></a> <table width="100%"><tr valign=top> <td> <h3>DB_ENV->txn_recover</h3> </td> <td align=right> <a href="../api_c/api_index.html"><img src="../images/api.gif" alt="API"></a> <a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> </td></tr></table> <hr size=1 noshade> <tt> <h3><pre> #include <db.h> <p> int DB_ENV->txn_recover(DB_ENV *dbenv, DB_PREPLIST preplist[], long count, long *retp, u_int32_t flags); </pre></h3> <hr size=1 noshade> <h3>Description: DB_ENV->txn_recover</h3> <p>The DB_ENV->txn_recover method returns a list of prepared but not yet resolved transactions. The DB_ENV->txn_recover method should only be called after the environment has been recovered. Because database environment state must be preserved between recovery and the application calling DB_ENV->txn_recover, applications must either call DB_ENV->txn_recover using the same environment handle used when recovery is done, or the database environment must not be configured using the <a href="../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag.</p> <p>On return from DB_ENV->txn_recover, the <b>preplist</b> parameter will be filled in with a list of transactions that must be resolved by the application (committed, aborted or discarded). The <b>preplist</b> parameter is a structure of type DB_PREPLIST; the following DB_PREPLIST fields will be filled in:</p> <p><dl compact> <dt>DB_TXN * txn;<dd>The transaction handle for the transaction. <dt>u_int8_t gid[DB_XIDDATASIZE];<dd>The global transaction ID for the transaction. The global transaction ID is the one specified when the transaction was prepared. The application is responsible for ensuring uniqueness among global transaction IDs. </dl> <p>The application must call <a href="../api_c/txn_abort.html">DB_TXN->abort</a>, <a href="../api_c/txn_commit.html">DB_TXN->commit</a> or <a href="../api_c/txn_discard.html">DB_TXN->discard</a> on each returned <a href="../api_c/txn_class.html">DB_TXN</a> handle before starting any new operations.</p> <p>The DB_ENV->txn_recover method returns a non-zero error value on failure and 0 on success. </p> <h3>Parameters</h3> <p><dl compact> <p><dt><b>count</b><dd> The <b>count</b> parameter specifies the number of available entries in the passed-in <b>preplist</b> array. The <b>retp</b> parameter returns the number of entries DB_ENV->txn_recover has filled in, in the array. <p><dt><b>flags</b><dd> The <b>flags</b> parameter must be set to one of the following values: <p><dl compact> <p><dt><a name="DB_FIRST">DB_FIRST</a><dd>Begin returning a list of prepared, but not yet resolved transactions. <p><dt><a name="DB_NEXT">DB_NEXT</a><dd>Continue returning a list of prepared, but not yet resolved transactions, starting where the last call to DB_ENV->txn_recover left off. </dl> <p><dt><b>preplist</b><dd> The <b>preplist</b> parameter references memory into which the list of transactions to be resolved by the application is copied. </dl> <hr size=1 noshade> <h3>Class</h3> <a href="../api_c/env_class.html">DB_ENV</a>, <a href="../api_c/txn_class.html">DB_TXN</a> <h3>See Also</h3> <a href="../api_c/txn_list.html">Transaction Subsystem and Related Methods</a> </tt> <table width="100%"><tr><td><br></td><td align=right> <a href="../api_c/api_index.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> </td></tr></table> <p><font size=1><a href="../sleepycat/legal.html">Copyright (c) 1996-2003</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> </body> </html>