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_pagesize</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_pagesize</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_pagesize(long pagesize)
29
<p>Set the size of the pages used to hold items in the database, in bytes.
30
The minimum page size is 512 bytes, and the maximum page size is 64K
31
bytes. If the page size is not explicitly set, one is selected based
32
on the underlying filesystem I/O block size. The automatically selected
33
size has a lower limit of 512 bytes and an upper limit of 16K bytes.
34
<p>For information on tuning the Berkeley DB page size, see
35
<a href="../ref/am_conf/pagesize.html">Selecting a page size</a>.
36
<p>The Db.set_pagesize 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_pagesize 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_pagesize will
43
If creating additional databases in a file, the page size specified must
44
be consistent with the existing databases in the file or an error will
46
<p>The Db.set_pagesize method throws an exception that encapsulates a non-zero error value on
49
<p>The Db.set_pagesize method may fail and throw an exception encapsulating a non-zero error for the following conditions:
51
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
52
<p>Called after <a href="../api_java/db_open.html">Db.open</a> was called.
54
<p>The Db.set_pagesize method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods.
55
If a catastrophic error has occurred, the Db.set_pagesize method may fail and
56
throw a <a href="../api_java/runrec_class.html">DbRunRecoveryException</a>,
57
in which case all subsequent Berkeley DB calls will fail in the same way.
59
<a href="../api_java/db_class.html">Db</a>
61
<a href="../api_java/db_list.html">Databases and Related Methods</a>
63
<table width="100%"><tr><td><br></td><td align=right>
64
<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>
66
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>