DbTxn* begin_txn(u_int32_t flags, DbEnv *env)
Begin a new transaction from the specified environment "env".
This function is called by dbstl user to begin an external transaction. The "flags" parameter is passed to DbEnv::txn_begin(). If a transaction created from the same database environment already exists and is unresolved, the new transaction is started as a child transaction of that transaction, and thus you can't specify the parent transaction.
dbstl transaction API.
You should call these API rather than DB C/C++ API to use Berkeley DB transaction features.