<!--$Id: config.so,v 10.20 2008/04/23 14:50:46 margo Exp $--> <!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> <head> <title>Berkeley DB Reference Guide: Configuring transactions</title> <meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> <meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> </head> <body bgcolor=white> <a name="2"><!--meow--></a> <table width="100%"><tr valign=top> <td><b><dl><dt>Berkeley DB Reference Guide:<dd>Transaction Subsystem</dl></b></td> <td align=right><a href="../txn/intro.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../txn/limits.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> <p align=center><b>Configuring transactions</b></p> <p>The application may change the number of simultaneous outstanding transactions supported by the Berkeley DB environment by calling the <a href="../../api_c/env_set_tx_max.html">DB_ENV->set_tx_max</a> method. This will also set the size of the underlying transaction subsystem's region. When the number of outstanding transactions is reached, additional calls to <a href="../../api_c/txn_begin.html">DB_ENV->txn_begin</a> will fail until some active transactions complete.</p> <p>The application can limit how long a transaction runs or blocks on contested resources. The <a href="../../api_c/env_set_timeout.html">DB_ENV->set_timeout</a> method specifies the length of the timeout. This value is checked whenever deadlock detection is performed or when the transaction is about to block on a lock that cannot be immediately granted. Because timeouts are only checked at these times, the accuracy of the timeout depends on how often deadlock detection is performed or how frequently the transaction blocks.</p> <p>There is an additional parameter used in configuring transactions; the <a href="../../api_c/env_set_flags.html#DB_TXN_NOSYNC">DB_TXN_NOSYNC</a> flag. Setting the <a href="../../api_c/env_set_flags.html#DB_TXN_NOSYNC">DB_TXN_NOSYNC</a> flag to <a href="../../api_c/env_set_flags.html">DB_ENV->set_flags</a> when opening a transaction region changes the behavior of transactions to not write or synchronously flush the log during transaction commit.</p> <p>This change may significantly increase application transactional throughput. However, it means that although transactions will continue to exhibit the ACI (atomicity, consistency, and isolation) properties, they will not have D (durability). Database integrity will be maintained, but it is possible that some number of the most recently committed transactions may be undone during recovery instead of being redone.</p> <table width="100%"><tr><td><br></td><td align=right><a href="../txn/intro.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../txn/limits.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> <p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> </body> </html>