1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DB_ENV->set_tx_max()</title>
7 <link rel="stylesheet" href="apiReference.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" />
10 <link rel="up" href="txn.html" title="Chapter 12. The DB_TXN Handle" />
11 <link rel="prev" href="envget_tx_timestamp.html" title="DB_ENV->get_tx_timestamp()" />
12 <link rel="next" href="envset_tx_timestamp.html" title="DB_ENV->set_tx_timestamp()" />
15 <div xmlns="" class="navheader">
17 <p>Library Version 11.2.5.3</p>
19 <table width="100%" summary="Navigation header">
21 <th colspan="3" align="center">DB_ENV->set_tx_max()</th>
24 <td width="20%" align="left"><a accesskey="p" href="envget_tx_timestamp.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 12.
28 <td width="20%" align="right"> <a accesskey="n" href="envset_tx_timestamp.html">Next</a></td>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
37 <h2 class="title" style="clear: both"><a id="envset_tx_max"></a>DB_ENV->set_tx_max()</h2>
41 <pre class="programlisting">#include <db.h>
44 DB_ENV->set_tx_max(DB_ENV *dbenv, u_int32_t max); </pre>
46 Configure the Berkeley DB database environment to support at least
47 <span class="bold"><strong>max</strong></span> active transactions. This value
48 bounds the size of the memory allocated for transactions. Child
49 transactions are counted as active until they either commit or abort.
52 Transactions that update multiversion databases are not freed until
53 the last page version that the transaction created is flushed from
54 cache. This means that applications using multi-version concurrency
55 control may need a transaction for each page in cache, in the extreme
59 When all of the memory available in the database environment for
60 transactions is in use, calls to
61 <a class="xref" href="txnbegin.html" title="DB_ENV->txn_begin()">DB_ENV->txn_begin()</a> will fail
62 (until some active transactions complete). If
63 <code class="classname">DB_ENV->set_tx_max()</code> is never called,
64 the database environment is configured to support at least 100
68 The database environment's number of active transactions may also
69 be configured using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The syntax
70 of the entry in that file is a single line with the string
71 "set_tx_max", one or more whitespace characters, and the number of
72 transactions. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read when the
73 database environment is opened, it will silently overrule
74 configuration done before that time.
77 The <code class="methodname">DB_ENV->set_tx_max()</code> method configures
78 a database environment, not only operations performed using the
79 specified <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> handle.
82 The <code class="methodname">DB_ENV->set_tx_max()</code> method may not be called after the
83 <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> method is called.
84 If the database environment already exists when
85 <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> is called, the
86 information specified to <code class="methodname">DB_ENV->set_tx_max()</code> will be ignored.
89 The <code class="methodname">DB_ENV->set_tx_max()</code> <span>
91 method returns a non-zero error value on failure and 0 on success.
96 <div class="sect2" lang="en" xml:lang="en">
97 <div class="titlepage">
100 <h3 class="title"><a id="idp62731576"></a>Parameters</h3>
104 <div class="sect3" lang="en" xml:lang="en">
105 <div class="titlepage">
108 <h4 class="title"><a id="idp62730928"></a>max</h4>
113 The <span class="bold"><strong>max</strong></span> parameter configures the
114 minimum number of simultaneously active transactions supported by
115 Berkeley DB database environment.
119 <div class="sect2" lang="en" xml:lang="en">
120 <div class="titlepage">
123 <h3 class="title"><a id="idp62718648"></a>Errors</h3>
128 The <code class="methodname">DB_ENV->set_tx_max()</code> <span>
130 method may fail and return one of the following non-zero errors:
135 <div class="sect3" lang="en" xml:lang="en">
136 <div class="titlepage">
139 <h4 class="title"><a id="idp62742280"></a>EINVAL</h4>
144 If the method was called after <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a>
145 was called; or if an invalid flag value or parameter was specified.
149 <div class="sect2" lang="en" xml:lang="en">
150 <div class="titlepage">
153 <h3 class="title"><a id="idp62730712"></a>Class</h3>
158 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>,
159 <a class="link" href="txn.html" title="Chapter 12. The DB_TXN Handle">DB_TXN</a>
162 <div class="sect2" lang="en" xml:lang="en">
163 <div class="titlepage">
166 <h3 class="title"><a id="idp62744512"></a>See Also</h3>
171 <a class="xref" href="txn.html#txnlist" title="Transaction Subsystem and Related Methods">Transaction Subsystem and Related Methods</a>
175 <div class="navfooter">
177 <table width="100%" summary="Navigation footer">
179 <td width="40%" align="left"><a accesskey="p" href="envget_tx_timestamp.html">Prev</a> </td>
180 <td width="20%" align="center">
181 <a accesskey="u" href="txn.html">Up</a>
183 <td width="40%" align="right"> <a accesskey="n" href="envset_tx_timestamp.html">Next</a></td>
186 <td width="40%" align="left" valign="top">DB_ENV->get_tx_timestamp() </td>
187 <td width="20%" align="center">
188 <a accesskey="h" href="index.html">Home</a>
190 <td width="40%" align="right" valign="top"> DB_ENV->set_tx_timestamp()</td>