Database environment recovery restores transactions that were
prepared, but not yet resolved at the time of the system shut down or
crash, to their state prior to the shut down or crash, including any
locks previously held. The <codeclass="methodname">DB_ENV->txn_recover()</code> method returns a
list of those prepared transactions.
</p>
<p>
The <codeclass="methodname">DB_ENV->txn_recover()</code> method should only be called after the
environment has been recovered.
</p>
<p>
Multiple threads of control may call <codeclass="methodname">DB_ENV->txn_recover()</code>, but only
one thread of control may resolve each returned transaction, that is,
only one thread of control may call <aclass="xref"href="txncommit.html"title="DB_TXN->commit()">DB_TXN->commit()</a>
or <aclass="xref"href="txnabort.html"title="DB_TXN->abort()">DB_TXN->abort()</a> on each
returned transaction. Callers of <codeclass="methodname">DB_ENV->txn_recover()</code> must call
<aclass="xref"href="txndiscard.html"title="DB_TXN->discard()">DB_TXN->discard()</a> to
discard each transaction they do not resolve.
</p>
<p>
On return from <codeclass="methodname">DB_ENV->txn_recover()</code>, the <spanclass="bold"><strong>preplist</strong></span> parameter will be filled in with a list of transactions
that must be resolved by the application (committed, aborted or discarded). The <spanclass="bold"><strong>preplist</strong></span> parameter is a structure of type
<codeclass="literal">DB_PREPLIST</code>; the following <codeclass="literal">DB_PREPLIST</code> fields will be
The <spanclass="bold"><strong>count</strong></span> parameter specifies the
number of available entries in the passed-in <spanclass="bold"><strong>preplist</strong></span> array. The <spanclass="bold"><strong>retp</strong></span> parameter returns the number of entries
<codeclass="methodname">DB_ENV->txn_recover()</code> has filled in, in the array.
<aclass="link"href="env.html"title="Chapter5. The DB_ENV Handle">DB_ENV</a>, <aclass="link"href="txn.html"title="Chapter12. The DB_TXN Handle">DB_TXN</a>