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>DB_ENV->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 6. The DB_LOCK Handle" /> 11 <link rel="prev" href="envset_lk_max_locks.html" title="DB_ENV->set_lk_max_locks()" /> 12 <link rel="next" href="envset_lk_partitions.html" title="DB_ENV->set_lk_partitions()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB_ENV->set_lk_max_objects()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="envset_lk_max_locks.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 6. 23 The DB_LOCK Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="envset_lk_partitions.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_objects"></a>DB_ENV->set_lk_max_objects()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_ENV->set_lk_max_objects(DB_ENV *dbenv, u_int32_t max); </pre> 42 <p> 43 Set the maximum number of locked objects supported by the Berkeley DB 44 environment. This value is used by 45 <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> to estimate how 46 much space to allocate for various lock-table data structures. The 47 default value is 1000 objects. 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 objects 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_objects", one or more whitespace characters, and the 55 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 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">DB_ENV->set_lk_max_objects()</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 DB_ENV Handle">DB_ENV</a> handle. 63 </p> 64 <p> 65 The <code class="methodname">DB_ENV->set_lk_max_objects()</code> method may not be called after the 66 <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> method is 67 called. If the database environment already exists when 68 <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> is called, the 69 information specified to <code class="methodname">DB_ENV->set_lk_max_objects()</code> will be 70 ignored. 71 </p> 72 <p> 73 The <code class="methodname">DB_ENV->set_lk_max_objects()</code> <span> 74 <span> 75 method returns a non-zero error value on failure and 0 on success. 76 </span> 77 78 </span> 79 </p> 80 <div class="sect2" lang="en" xml:lang="en"> 81 <div class="titlepage"> 82 <div> 83 <div> 84 <h3 class="title"><a id="id1676350"></a>Parameters</h3> 85 </div> 86 </div> 87 </div> 88 <div class="sect3" lang="en" xml:lang="en"> 89 <div class="titlepage"> 90 <div> 91 <div> 92 <h4 class="title"><a id="id1676381"></a>max</h4> 93 </div> 94 </div> 95 </div> 96 <p> 97 The <span class="bold"><strong>max</strong></span> parameter is the maximum 98 number of locked objects supported by the Berkeley DB environment. 99 </p> 100 </div> 101 </div> 102 <div class="sect2" lang="en" xml:lang="en"> 103 <div class="titlepage"> 104 <div> 105 <div> 106 <h3 class="title"><a id="id1676526"></a>Errors</h3> 107 </div> 108 </div> 109 </div> 110 <p> 111 The <code class="methodname">DB_ENV->set_lk_max_objects()</code> <span> 112 <span> 113 method may fail and return one of the following non-zero errors: 114 </span> 115 116 </span> 117 </p> 118 <div class="sect3" lang="en" xml:lang="en"> 119 <div class="titlepage"> 120 <div> 121 <div> 122 <h4 class="title"><a id="id1676451"></a>EINVAL</h4> 123 </div> 124 </div> 125 </div> 126 <p> 127 If the method was called after <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> 128 was called; or if an invalid flag value or parameter was specified. 129 </p> 130 </div> 131 </div> 132 <div class="sect2" lang="en" xml:lang="en"> 133 <div class="titlepage"> 134 <div> 135 <div> 136 <h3 class="title"><a id="id1676436"></a>Class</h3> 137 </div> 138 </div> 139 </div> 140 <p> 141 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>, 142 <a class="link" href="lock.html" title="Chapter 6. The DB_LOCK Handle">DB_LOCK</a> 143 </p> 144 </div> 145 <div class="sect2" lang="en" xml:lang="en"> 146 <div class="titlepage"> 147 <div> 148 <div> 149 <h3 class="title"><a id="id1676472"></a>See Also</h3> 150 </div> 151 </div> 152 </div> 153 <p> 154 <a class="xref" href="lock.html#locklist" title="Locking Subsystem and Related Methods">Locking Subsystem and Related Methods</a> 155 </p> 156 </div> 157 </div> 158 <div class="navfooter"> 159 <hr /> 160 <table width="100%" summary="Navigation footer"> 161 <tr> 162 <td width="40%" align="left"><a accesskey="p" href="envset_lk_max_locks.html">Prev</a> </td> 163 <td width="20%" align="center"> 164 <a accesskey="u" href="lock.html">Up</a> 165 </td> 166 <td width="40%" align="right"> <a accesskey="n" href="envset_lk_partitions.html">Next</a></td> 167 </tr> 168 <tr> 169 <td width="40%" align="left" valign="top">DB_ENV->set_lk_max_locks() </td> 170 <td width="20%" align="center"> 171 <a accesskey="h" href="index.html">Home</a> 172 </td> 173 <td width="40%" align="right" valign="top"> DB_ENV->set_lk_partitions()</td> 174 </tr> 175 </table> 176 </div> 177 </body> 178</html> 179