1<!--$Id: config.so,v 10.20 2008/04/23 14:50:46 margo Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB Reference Guide: Configuring transactions</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<a name="2"><!--meow--></a> 12<table width="100%"><tr valign=top> 13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Transaction Subsystem</dl></b></td> 14<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> 15</td></tr></table> 16<p align=center><b>Configuring transactions</b></p> 17<p>The application may change the number of simultaneous outstanding 18transactions supported by the Berkeley DB environment by calling the 19<a href="/api_c/env_set_tx_max.html">DB_ENV->set_tx_max</a> method. This will also set the size of the 20underlying transaction subsystem's region. When the number of 21outstanding transactions is reached, additional calls to 22<a href="/api_c/txn_begin.html">DB_ENV->txn_begin</a> will fail until some active transactions complete.</p> 23<p>The application can limit how long a transaction runs or blocks on 24contested resources. 25The <a href="/api_c/env_set_timeout.html">DB_ENV->set_timeout</a> method specifies the length of the timeout. 26This value is checked whenever deadlock detection is performed or 27when the transaction is about to block on a lock that cannot be 28immediately granted. 29Because timeouts are only checked at these times, the accuracy of the 30timeout depends on how often deadlock detection is performed or how 31frequently the transaction blocks.</p> 32<p>There is an additional parameter used in configuring transactions; the 33<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 34<a href="/api_c/env_set_flags.html">DB_ENV->set_flags</a> when opening a transaction region changes the 35behavior of transactions to not write or synchronously flush the log 36during transaction commit.</p> 37<p>This change may significantly increase application transactional 38throughput. However, it means that although transactions will continue 39to exhibit the ACI (atomicity, consistency, and isolation) properties, 40they will not have D (durability). Database integrity will be 41maintained, but it is possible that some number of the most recently 42committed transactions may be undone during recovery instead of being 43redone.</p> 44<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> 45</td></tr></table> 46<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 47</body> 48</html> 49