int db::Database::set_default_completion_mode ( TxCompletionMode  mode  ) 

Set the default transaction completion mode.

The given completion mode will be used for subsequent calls to tx_commit and tx_abort when DB_DEFAULT_COMPLETION is selected.

Until set_default_completion_mode is called, the default completion mode is DB_GROUP_COMPLETION.

Parameters:
mode The default transaction completion mode. (required)
  • DB_LAZY_COMPLETION: Perform lazy completion.

    The transaction status is not written to disk, which may cause the transaction to abort if a crash occurs before the journal is flushed. Call Database::tx_flush to force lazily completed transactions to complete.

  • DB_GROUP_COMPLETION: Perform group completion.

    The transaction will wait for all other active transactions to be committed and perform the commit for all transactions as a group. This improves performance when several transactions are active at the same time by reducing the amount of disk I/O that is performed. If no other transactions are active, or if 50 milliseconds elapses before the other transactions are committed, the transaction will stop waiting and complete immediately.

    Database::tx_commit will not return until the transaction is fully flushed to disk.

  • DB_FORCED_COMPLETION: Force completion immediately.

    The transaction will be fully flushed to disk before Database::tx_commit returns.

Returns:
See also:
tx_commit, tx_abort, get_default_completion_mode


Copyright © 2005-2008 ITTIA®. All rights reserved.