#include <db_cxx.h> int DbTxn::set_commit_token(DB_TXN_TOKEN *buffer);
The DbTxn::set_commit_token()
method
configures the transaction for commit token generation, and accepts
the address of an application-supplied buffer to receive the token.
The actual generation of the token contents does not occur until
commit time.
Commit tokens are used to enable some consistency guarantees for replicated applications. Please see the Read your writes consistency section in the Berkeley DB Programmer's Reference Guide for more information.
The DbTxn::set_commit_token()
method may be
called at any time after the
DbEnv::txn_begin()
method has been called, and before
DbTxn::commit()
has been called.
The DbTxn::set_commit_token()
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 DbTxn::set_commit_token()
method may fail and throw a DbException
exception, encapsulating one of the following non-zero errors, or return one
of the following non-zero errors: