2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB: Db.set_h_nelem</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<a name="2"><!--meow--></a>
13
<table width="100%"><tr valign=top>
15
<h1>Db.set_h_nelem</h1>
18
<a href="../api_java/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
23
import com.sleepycat.db.*;
25
public void set_h_nelem(int h_nelem)
29
<p>Set an estimate of the final size of the hash table.
30
<p>In order for the estimate to be used when creating the database,
31
the <a href="../api_java/db_set_h_ffactor.html">Db.set_h_ffactor</a> method must also be called.
32
If the estimate or fill factor are not set or are set too low,
33
hash tables will still expand gracefully
34
as keys are entered, although a slight performance degradation may be
36
<p>The Db.set_h_nelem method configures a database, not only operations performed
37
using the specified <a href="../api_java/db_class.html">Db</a> handle.
38
<p>The Db.set_h_nelem interface may not be called after the <a href="../api_java/db_open.html">Db.open</a>
40
If the database already exists when
41
<a href="../api_java/db_open.html">Db.open</a> is called, the information specified to Db.set_h_nelem will
43
<p>The Db.set_h_nelem method throws an exception that encapsulates a non-zero error value on
46
<p>The Db.set_h_nelem method may fail and throw an exception encapsulating a non-zero error for the following conditions:
48
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
49
<p>Called after <a href="../api_java/db_open.html">Db.open</a> was called.
51
<p>The Db.set_h_nelem method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods.
52
If a catastrophic error has occurred, the Db.set_h_nelem method may fail and
53
throw a <a href="../api_java/runrec_class.html">DbRunRecoveryException</a>,
54
in which case all subsequent Berkeley DB calls will fail in the same way.
56
<a href="../api_java/db_class.html">Db</a>
58
<a href="../api_java/db_list.html">Databases and Related Methods</a>
60
<table width="100%"><tr><td><br></td><td align=right>
61
<a href="../api_java/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
63
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>