DbEnv::txn_recover |
#include <db_cxx.h>int DbEnv::txn_recover(DB_PREPLIST preplist[], long count, long *retp, u_int32_t flags);
The DbEnv::txn_recover interface returns a list of prepared but not yet resolved transactions. The DbEnv::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 DbEnv::txn_recover, applications must either call DbEnv::txn_recover using the same environment handle used when recovery is done, or the database environment must not be configured using the DB_PRIVATE flag.
On return from DbEnv::txn_recover, the preplist argument will be filled in with a list of transactions that must be resolved by the application (committed, aborted or discarded). The preplist argument is a structure of type DB_PREPLIST; the following DB_PREPLIST fields will be filled in:
The application must call DbTxn::abort, DbTxn::commit or DbTxn::discard on each returned DbTxn handle before starting any new operations.
The count parameter specifies the number of available entries in the passed-in preplist array. The retp parameter returns the number of entries DbEnv::txn_recover has filled in, in the array.
The flags value must be set to one of the following values:
The DbEnv::txn_recover method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.
The DbEnv::txn_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. If a catastrophic error has occurred, the DbEnv::txn_recover method may fail and either return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.