1<!--$Id: env_set_lk_max_objects.so,v 1.23 2004/09/28 15:04:20 bostic 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: DB_ENV-&gt;set_lk_max_objects</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<table width="100%"><tr valign=top>
12<td>
13<b>DB_ENV-&gt;set_lk_max_objects</b>
14</td>
15<td align=right>
16<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a>
17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
18</tr></table>
19<hr size=1 noshade>
20<tt>
21<b><pre>
22#include &lt;db.h&gt;
23<p>
24int
25DB_ENV-&gt;set_lk_max_objects(DB_ENV *dbenv, u_int32_t max);
26<p>
27int
28DB_ENV-&gt;get_lk_max_objects(DB_ENV *dbenv, u_int32_t *lk_maxp);
29</pre></b>
30<hr size=1 noshade>
31<b>Description: DB_ENV-&gt;set_lk_max_objects</b>
32<p>Set the maximum number of locked objects supported by the Berkeley DB
33environment.  This value is used by <a href="../api_c/env_open.html">DB_ENV-&gt;open</a> to estimate how
34much space to allocate for various lock-table data structures.  The
35default value is 1000 objects.  For specific information on configuring
36the size of the lock subsystem, see <a href="../ref/lock/max.html">Configuring locking: sizing the system</a>.</p>
37<p>The database environment's maximum number of objects may also be configured using the
38environment's <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file.  The syntax of the entry in that
39file is a single line with the string "set_lk_max_objects", one or more whitespace
40characters, and the number of objects.
41Because the <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment
42is opened, it will silently overrule configuration done before that
43time.</p>
44<p>The DB_ENV-&gt;set_lk_max_objects method configures a database environment, not only operations
45performed using the specified <a href="../api_c/env_class.html">DB_ENV</a> handle.</p>
46<p>The DB_ENV-&gt;set_lk_max_objects method may not be called after the <a href="../api_c/env_open.html">DB_ENV-&gt;open</a> method is
47called.
48If the database environment already exists when
49<a href="../api_c/env_open.html">DB_ENV-&gt;open</a> is called, the information specified to DB_ENV-&gt;set_lk_max_objects
50will be ignored.
51</p>
52<p>The DB_ENV-&gt;set_lk_max_objects method
53returns a non-zero error value on failure
54and 0 on success.
55</p>
56<b>Parameters</b> <br>
57 <b>max</b><ul compact><li>The <b>max</b> parameter is the maximum number of locked objects
58supported by the Berkeley DB environment.</ul>
59<br>
60<br><b>Errors</b>
61<p>The DB_ENV-&gt;set_lk_max_objects method
62may fail and return one of the following non-zero errors:</p>
63<br>
64<b>EINVAL</b><ul compact><li>If the method was called after <a href="../api_c/env_open.html">DB_ENV-&gt;open</a> was called; or if an
65invalid flag value or parameter was specified.</ul>
66<br>
67<hr size=1 noshade>
68<b>Description: DB_ENV-&gt;get_lk_max_objects</b>
69<p>The DB_ENV-&gt;get_lk_max_objects method returns the maximum number of locked objects.</p>
70<p>The DB_ENV-&gt;get_lk_max_objects method may be called at any time during the life of the
71application.</p>
72<p>The DB_ENV-&gt;get_lk_max_objects method
73returns a non-zero error value on failure
74and 0 on success.
75</p>
76<b>Parameters</b> <br>
77 <b>lk_maxp</b><ul compact><li>The DB_ENV-&gt;get_lk_max_objects method returns  the
78maximum number of locked objects in <b>lk_maxp</b>.</ul>
79<br>
80<hr size=1 noshade>
81<br><b>Class</b>
82<a href="../api_c/env_class.html">DB_ENV</a>, <a href="../api_c/lock_class.html">DB_LOCK</a>
83<br><b>See Also</b>
84<a href="../api_c/lock_list.html">Locking Subsystem and Related Methods</a>
85</tt>
86<table width="100%"><tr><td><br></td><td align=right>
87<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
88</td></tr></table>
89<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
90</body>
91</html>
92