#include <db.h> int DB_TXN->set_commit_token(DB_TXN *txn, DB_TXN_TOKEN *buffer);
The DB_TXN->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 DB_TXN->set_commit_token()
method may be
called at any time after the
DB_ENV->txn_begin()
method has been called, and before
DB_TXN->commit()
has been called.
The DB_TXN->set_commit_token()
method returns a non-zero error value on failure and 0 on success.
The DB_TXN->set_commit_token()
method may fail and return one of the following non-zero errors: