1<!--$Id: env_set_lk_max_lockers.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: DbEnv::set_lk_max_lockers</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>DbEnv::set_lk_max_lockers</b> 14</td> 15<td align=right> 16<a href="../api_cxx/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 <db_cxx.h> 23<p> 24int 25DbEnv::set_lk_max_lockers(u_int32_t max); 26<p> 27int 28DbEnv::get_lk_max_lockers(u_int32_t *, lk_maxp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbEnv::set_lk_max_lockers</b> 32<p>Set the maximum number of locking entities supported by the Berkeley DB 33environment. This value is used by <a href="../api_cxx/env_open.html">DbEnv::open</a> to estimate how 34much space to allocate for various lock-table data structures. The 35default value is 1000 lockers. 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 lockers 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_lockers", one or more whitespace 40characters, and the number of lockers. 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 DbEnv::set_lk_max_lockers method configures a database environment, not only operations 45performed using the specified <a href="../api_cxx/env_class.html">DbEnv</a> handle.</p> 46<p>The DbEnv::set_lk_max_lockers method may not be called after the <a href="../api_cxx/env_open.html">DbEnv::open</a> method is 47called. 48If the database environment already exists when 49<a href="../api_cxx/env_open.html">DbEnv::open</a> is called, the information specified to DbEnv::set_lk_max_lockers 50will be ignored. 51</p> 52<p>The DbEnv::set_lk_max_lockers method 53either returns a non-zero error value 54or throws an exception that encapsulates a non-zero error value on 55failure, and returns 0 on success. 56</p> 57<b>Parameters</b> <br> 58 <b>max</b><ul compact><li>The <b>max</b> parameter is the maximum number simultaneous locking 59entities supported by the Berkeley DB environment.</ul> 60<br> 61<br><b>Errors</b> 62<p>The DbEnv::set_lk_max_lockers method 63may fail and throw 64<a href="../api_cxx/except_class.html">DbException</a>, 65encapsulating one of the following non-zero errors, or return one of 66the following non-zero errors:</p> 67<br> 68<b>EINVAL</b><ul compact><li>If the method was called after <a href="../api_cxx/env_open.html">DbEnv::open</a> was called; or if an 69invalid flag value or parameter was specified.</ul> 70<br> 71<hr size=1 noshade> 72<b>Description: DbEnv::get_lk_max_lockers</b> 73<p>The DbEnv::get_lk_max_lockers method returns the maximum number of lockers.</p> 74<p>The DbEnv::get_lk_max_lockers method may be called at any time during the life of the 75application.</p> 76<p>The DbEnv::get_lk_max_lockers method 77either returns a non-zero error value 78or throws an exception that encapsulates a non-zero error value on 79failure, and returns 0 on success. 80</p> 81<b>Parameters</b> <br> 82 <b>lk_maxp</b><ul compact><li>The DbEnv::get_lk_max_lockers method returns the 83maximum number of lockers in <b>lk_maxp</b>.</ul> 84<br> 85<hr size=1 noshade> 86<br><b>Class</b> 87<a href="../api_cxx/env_class.html">DbEnv</a>, <a href="../api_cxx/lock_class.html">DbLock</a> 88<br><b>See Also</b> 89<a href="../api_cxx/lock_list.html">Locking Subsystem and Related Methods</a> 90</tt> 91<table width="100%"><tr><td><br></td><td align=right> 92<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 93</td></tr></table> 94<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 95</body> 96</html> 97