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"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DbEnv::set_lk_max_lockers()</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="lock.html" title="Chapter 7. The DbLock Handle" /> 11 <link rel="prev" href="envset_lk_detect.html" title="DbEnv::set_lk_detect()" /> 12 <link rel="next" href="envset_lk_max_locks.html" title="DbEnv::set_lk_max_locks()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::set_lk_max_lockers()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="envset_lk_detect.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 7. 23 The DbLock Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="envset_lk_max_locks.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="envset_lk_max_lockers"></a>DbEnv::set_lk_max_lockers()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::set_lk_max_lockers(u_int32_t max); </pre> 42 <p> 43 Set the maximum number of locking entities supported by the Berkeley 44 DB environment. This value is used by 45 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> to estimate how 46 much space to allocate for various lock-table data structures. The 47 default value is 1000 lockers. For specific information on 48 configuring the size of the lock subsystem, see <a href="../../programmer_reference/lock_max.html" class="olink">Configuring locking: sizing the system</a>. 49 </p> 50 <p> 51 The database environment's maximum number of lockers may also be 52 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 53 syntax of the entry in that file is a single line with the string 54 "set_lk_max_lockers", one or more whitespace characters, and the 55 number of lockers. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is 56 read when the database environment is opened, it will silently 57 overrule configuration done before that time. 58 </p> 59 <p> 60 The <code class="methodname">DbEnv::set_lk_max_lockers()</code> method configures a database 61 environment, not only operations performed using the specified 62 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> handle. 63 </p> 64 <p> 65 The <code class="methodname">DbEnv::set_lk_max_lockers()</code> method may not be called after the 66 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method is 67 called. If the database environment already exists when 68 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> is called, the 69 information specified to <code class="methodname">DbEnv::set_lk_max_lockers()</code> will be 70 ignored. 71 </p> 72 <p> 73 The <code class="methodname">DbEnv::set_lk_max_lockers()</code> <span> 74 75 <span> 76 method either returns a non-zero error value or throws an 77 exception that encapsulates a non-zero error value on 78 failure, and returns 0 on success. 79 </span> 80 </span> 81 </p> 82 <div class="sect2" lang="en" xml:lang="en"> 83 <div class="titlepage"> 84 <div> 85 <div> 86 <h3 class="title"><a id="id1680152"></a>Parameters</h3> 87 </div> 88 </div> 89 </div> 90 <div class="sect3" lang="en" xml:lang="en"> 91 <div class="titlepage"> 92 <div> 93 <div> 94 <h4 class="title"><a id="id1679753"></a>max</h4> 95 </div> 96 </div> 97 </div> 98 <p> 99 The <span class="bold"><strong>max</strong></span> parameter is the maximum 100 number simultaneous locking entities supported by the Berkeley DB 101 environment. 102 </p> 103 </div> 104 </div> 105 <div class="sect2" lang="en" xml:lang="en"> 106 <div class="titlepage"> 107 <div> 108 <div> 109 <h3 class="title"><a id="id1680269"></a>Errors</h3> 110 </div> 111 </div> 112 </div> 113 <p> 114 The <code class="methodname">DbEnv::set_lk_max_lockers()</code> <span> 115 116 <span> 117 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 118 exception, encapsulating one of the following non-zero errors, or return one 119 of the following non-zero errors: 120 </span> 121 </span> 122 </p> 123 <div class="sect3" lang="en" xml:lang="en"> 124 <div class="titlepage"> 125 <div> 126 <div> 127 <h4 class="title"><a id="id1679882"></a>EINVAL</h4> 128 </div> 129 </div> 130 </div> 131 <p> 132 If the method was called after <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> 133 was called; or if an invalid flag value or parameter was specified. 134 </p> 135 </div> 136 </div> 137 <div class="sect2" lang="en" xml:lang="en"> 138 <div class="titlepage"> 139 <div> 140 <div> 141 <h3 class="title"><a id="id1680264"></a>Class</h3> 142 </div> 143 </div> 144 </div> 145 <p> 146 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a>, 147 <a class="link" href="lock.html" title="Chapter 7. The DbLock Handle">DbLock</a> 148 </p> 149 </div> 150 <div class="sect2" lang="en" xml:lang="en"> 151 <div class="titlepage"> 152 <div> 153 <div> 154 <h3 class="title"><a id="id1679880"></a>See Also</h3> 155 </div> 156 </div> 157 </div> 158 <p> 159 <a class="xref" href="lock.html#locklist" title="Locking Subsystem and Related Methods">Locking Subsystem and Related Methods</a> 160 </p> 161 </div> 162 </div> 163 <div class="navfooter"> 164 <hr /> 165 <table width="100%" summary="Navigation footer"> 166 <tr> 167 <td width="40%" align="left"><a accesskey="p" href="envset_lk_detect.html">Prev</a> </td> 168 <td width="20%" align="center"> 169 <a accesskey="u" href="lock.html">Up</a> 170 </td> 171 <td width="40%" align="right"> <a accesskey="n" href="envset_lk_max_locks.html">Next</a></td> 172 </tr> 173 <tr> 174 <td width="40%" align="left" valign="top">DbEnv::set_lk_detect() </td> 175 <td width="20%" align="center"> 176 <a accesskey="h" href="index.html">Home</a> 177 </td> 178 <td width="40%" align="right" valign="top"> DbEnv::set_lk_max_locks()</td> 179 </tr> 180 </table> 181 </div> 182 </body> 183</html> 184