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