1<!--$Id: memp_set_maxsize.so,v 1.15 2005/09/17 16:30:18 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: DbMpoolFile::set_maxsize</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>DbMpoolFile::set_maxsize</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 &lt;db_cxx.h&gt;
23<p>
24int
25DbMpoolFile::set_maxsize(u_int32_t gbytes, u_int32_t bytes);
26<p>
27int
28DbMpoolFile::get_maxsize(u_int32_t *gbytesp, u_int32_t *bytesp);
29</pre></b>
30<hr size=1 noshade>
31<b>Description: DbMpoolFile::set_maxsize</b>
32<p>Set the maximum size for the file to be <b>gbytes</b> gigabytes plus
33<b>bytes</b>.  Attempts to allocate new pages in the file after the
34limit has been reached will fail.</p>
35<p>To set the maximum file size for a particular database, call the
36DbMpoolFile::set_maxsize method using the <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a> handle stored
37in the <b>mpf</b> field of the <a href="../api_cxx/db_class.html">Db</a> handle.  Attempts to insert
38new items into the database after the limit has been reached may fail.</p>
39<p>The DbMpoolFile::set_maxsize method configures a file in the memory pool, not only
40operations performed using the specified <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a> handle.</p>
41<p>The DbMpoolFile::set_maxsize method may be called at any time during the life of the
42application.</p>
43<p>The DbMpoolFile::set_maxsize method
44either returns a non-zero error value
45or throws an exception that encapsulates a non-zero error value on
46failure, and returns 0 on success.
47</p>
48<b>Parameters</b> <br>
49 <b>bytes</b><ul compact><li>The maximum size of the file is set to <b>gbytes</b> gigabytes plus
50<b>bytes</b>.</ul>
51 <b>gbytes</b><ul compact><li>The maximum size of the file is set to <b>gbytes</b> gigabytes plus
52<b>bytes</b>.</ul>
53<br>
54<hr size=1 noshade>
55<b>Description: DbMpoolFile::get_maxsize</b>
56<p>The DbMpoolFile::get_maxsize method
57either returns a non-zero error value
58or throws an exception that encapsulates a non-zero error value on
59failure, and returns 0 on success.
60</p>
61<p>The DbMpoolFile::get_maxsize method may be called at any time during the life of the
62application.</p>
63<b>Parameters</b> <br>
64 <b>bytesp</b><ul compact><li>The <b>bytesp</b> parameter references memory into which
65 the additional bytes of memory in the maximum file size is copied.</ul> 
66 <b>gbytesp</b><ul compact><li>The <b>gbytesp</b> parameter references memory into which
67 the gigabytes of memory in the maximum file size is copied.</ul> 
68<br>
69<hr size=1 noshade>
70<br><b>Class</b>
71<a href="../api_cxx/env_class.html">DbEnv</a>, <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a>
72<br><b>See Also</b>
73<a href="../api_cxx/memp_list.html">Memory Pools and Related Methods</a>
74</tt>
75<table width="100%"><tr><td><br></td><td align=right>
76<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>
77</td></tr></table>
78<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
79</body>
80</html>
81