| 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::set_heap_regionsize()</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="db.html" title="Chapter 2. The Db Handle" /> |
| 11 |
<link rel="prev" href="dbset_heapsize.html" title="Db::set_heapsize()" /> |
| 12 |
<link rel="next" href="dbset_lk_exclusive.html" title="Db::set_lk_exclusive()" /> |
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div xmlns="" class="navheader"> |
| 16 |
<div class="libver"> |
| 17 |
<p>Library Version 11.2.5.3</p> |
| 18 |
</div> |
| 19 |
<table width="100%" summary="Navigation header"> |
| 20 |
<tr> |
| 21 |
<th colspan="3" align="center">Db::set_heap_regionsize()</th> |
| 22 |
</tr> |
| 23 |
<tr> |
| 24 |
<td width="20%" align="left"><a accesskey="p" href="dbset_heapsize.html">Prev</a> </td> |
| 25 |
<th width="60%" align="center">Chapter 2. |
| 26 |
The Db Handle |
| 27 |
</th> |
| 28 |
<td width="20%" align="right"> <a accesskey="n" href="dbset_lk_exclusive.html">Next</a></td> |
| 29 |
</tr> |
| 30 |
</table> |
| 31 |
<hr /> |
| 32 |
</div> |
| 33 |
<div class="sect1" lang="en" xml:lang="en"> |
| 34 |
<div class="titlepage"> |
| 35 |
<div> |
| 36 |
<div> |
| 37 |
<h2 class="title" style="clear: both"><a id="dbset_heap_regionsize"></a>Db::set_heap_regionsize()</h2> |
| 38 |
</div> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
<pre class="programlisting">#include <db_cxx.h> |
| 42 |
|
| 43 |
int |
| 44 |
Db::set_heap_regionsize(u_int32_t npages); </pre> |
| 45 |
<p> |
| 46 |
Sets the number of pages in a region of a database configured to |
| 47 |
use the Heap access method. If this method is never called, the |
| 48 |
default region size for the database's page size will be used. You |
| 49 |
can set the database page size using the |
| 50 |
<a class="xref" href="dbset_pagesize.html" title="Db::set_pagesize()">Db::set_pagesize()</a> |
| 51 |
method. |
| 52 |
</p> |
| 53 |
<p> |
| 54 |
The <code class="methodname">Db::set_heap_regionsize()</code> method may not be |
| 55 |
called after the <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> |
| 56 |
method is called. If the database already exists when |
| 57 |
<a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> is called, the |
| 58 |
information specified to |
| 59 |
<code class="methodname">Db::set_heap_regionsize()</code> will be |
| 60 |
ignored. If the specified region size is larger than the maximum |
| 61 |
region size for the database's page size, an error will be |
| 62 |
returned when <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> is |
| 63 |
called. The maximum allowable region size will be included in the |
| 64 |
error message. |
| 65 |
</p> |
| 66 |
<p> |
| 67 |
The <code class="methodname">Db::set_heap_regionsize()</code> <span> |
| 68 |
|
| 69 |
<span> |
| 70 |
method either returns a non-zero error value or throws an |
| 71 |
exception that encapsulates a non-zero error value on |
| 72 |
failure, and returns 0 on success. |
| 73 |
</span> |
| 74 |
</span> |
| 75 |
</p> |
| 76 |
<div class="sect2" lang="en" xml:lang="en"> |
| 77 |
<div class="titlepage"> |
| 78 |
<div> |
| 79 |
<div> |
| 80 |
<h3 class="title"><a id="idp5666456"></a>Parameters</h3> |
| 81 |
</div> |
| 82 |
</div> |
| 83 |
</div> |
| 84 |
<div class="sect3" lang="en" xml:lang="en"> |
| 85 |
<div class="titlepage"> |
| 86 |
<div> |
| 87 |
<div> |
| 88 |
<h4 class="title"><a id="idp5666624"></a>npages</h4> |
| 89 |
</div> |
| 90 |
</div> |
| 91 |
</div> |
| 92 |
<p> |
| 93 |
The <span class="bold"><strong>npages</strong></span> parameter is |
| 94 |
the number of pages in a Heap database region. |
| 95 |
</p> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
<div class="sect2" lang="en" xml:lang="en"> |
| 99 |
<div class="titlepage"> |
| 100 |
<div> |
| 101 |
<div> |
| 102 |
<h3 class="title"><a id="idp5659424"></a>Errors</h3> |
| 103 |
</div> |
| 104 |
</div> |
| 105 |
</div> |
| 106 |
<p> |
| 107 |
The <code class="methodname">Db::set_heap_regionsize()</code> <span> |
| 108 |
|
| 109 |
<span> |
| 110 |
method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> |
| 111 |
exception, encapsulating one of the following non-zero errors, or return one |
| 112 |
of the following non-zero errors: |
| 113 |
</span> |
| 114 |
</span> |
| 115 |
</p> |
| 116 |
<div class="sect3" lang="en" xml:lang="en"> |
| 117 |
<div class="titlepage"> |
| 118 |
<div> |
| 119 |
<div> |
| 120 |
<h4 class="title"><a id="idp5673336"></a>EINVAL</h4> |
| 121 |
</div> |
| 122 |
</div> |
| 123 |
</div> |
| 124 |
<p> |
| 125 |
If the specified region size was too small; the method was |
| 126 |
called after <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> |
| 127 |
was called; or if an invalid flag value or parameter was specified. |
| 128 |
</p> |
| 129 |
</div> |
| 130 |
</div> |
| 131 |
<div class="sect2" lang="en" xml:lang="en"> |
| 132 |
<div class="titlepage"> |
| 133 |
<div> |
| 134 |
<div> |
| 135 |
<h3 class="title"><a id="idp5674664"></a>Class</h3> |
| 136 |
</div> |
| 137 |
</div> |
| 138 |
</div> |
| 139 |
<p> |
| 140 |
<a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> |
| 141 |
</p> |
| 142 |
</div> |
| 143 |
<div class="sect2" lang="en" xml:lang="en"> |
| 144 |
<div class="titlepage"> |
| 145 |
<div> |
| 146 |
<div> |
| 147 |
<h3 class="title"><a id="idp5647896"></a>See Also</h3> |
| 148 |
</div> |
| 149 |
</div> |
| 150 |
</div> |
| 151 |
<p> |
| 152 |
<a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a>, |
| 153 |
<a class="xref" href="dbget_heap_regionsize.html" title="Db::get_heap_regionsize()">Db::get_heap_regionsize()</a> |
| 154 |
</p> |
| 155 |
</div> |
| 156 |
</div> |
| 157 |
<div class="navfooter"> |
| 158 |
<hr /> |
| 159 |
<table width="100%" summary="Navigation footer"> |
| 160 |
<tr> |
| 161 |
<td width="40%" align="left"><a accesskey="p" href="dbset_heapsize.html">Prev</a> </td> |
| 162 |
<td width="20%" align="center"> |
| 163 |
<a accesskey="u" href="db.html">Up</a> |
| 164 |
</td> |
| 165 |
<td width="40%" align="right"> <a accesskey="n" href="dbset_lk_exclusive.html">Next</a></td> |
| 166 |
</tr> |
| 167 |
<tr> |
| 168 |
<td width="40%" align="left" valign="top">Db::set_heapsize() </td> |
| 169 |
<td width="20%" align="center"> |
| 170 |
<a accesskey="h" href="index.html">Home</a> |
| 171 |
</td> |
| 172 |
<td width="40%" align="right" valign="top"> Db::set_lk_exclusive()</td> |
| 173 |
</tr> |
| 174 |
</table> |
| 175 |
</div> |
| 176 |
</body> |
| 177 |
</html> |