#include <DbXml.hpp> void XmlTransaction::commit(u_int32_t flags = 0)
The XmlTransaction::commit
method ends the
transaction. Container and document modifications made within the
scope of the transaction are by default written to stable storage.
After XmlTransaction::commit has been called, regardless
of its return, the
XmlTransaction
handle may not be accessed
again. If
encounters an error, the transaction and all child transactions of
the transaction are aborted.
XmlTransaction
::commit
The XmlTransaction::commit
method throws an
exception that encapsulates a non-zero error value on failure.
This parameter must be set to 0 or one of the following values:
Do not synchronously flush the log. This means the transaction will exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database integrity will be maintained, but it is possible that this transaction may be undone during recovery.
This behavior may also be set for a Berkeley DB
environment using the DbEnv::set_flags()
method or
for a single transaction using the
XmlManager::createTransaction method. Any value
specified to this method overrides both of those
settings.
Synchronously flush the log. This means the transaction will exhibit all of the ACID (atomicity, consistency, isolation, and durability) properties.
This behavior is the default for Berkeley DB
environments unless the DB_TXN_NOSYNC
flag was
specified to the DbEnv::set_flags()
method. This
behavior may also be set for a single transaction using
the XmlManager::createTransaction method. Any value
specified to this method overrides both of those
settings.
The XmlTransaction::commit
method may fail
and throw
XmlException
, encapsulating one of the following
non-zero errors:
You are using a replicated enviroment, the master lease is expired, and DBXML_IGNORE_LEASE is not enabled.