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>DbMpoolFile::set_maxsize()</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="memp.html" title="Chapter 9. The DbMpoolFile Handle" /> 11 <link rel="prev" href="mempset_lsn_offset.html" title="DbMpoolFile::set_lsn_offset()" /> 12 <link rel="next" href="mempset_pgcookie.html" title="DbMpoolFile::set_pgcookie()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbMpoolFile::set_maxsize()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempset_lsn_offset.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 9. 23 The DbMpoolFile Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="mempset_pgcookie.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="mempset_maxsize"></a>DbMpoolFile::set_maxsize()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbMpoolFile::set_maxsize(u_int32_t gbytes, u_int32_t bytes); </pre> 42 <p> 43 Set the maximum size for the file to be <span class="bold"><strong>gbytes</strong></span> gigabytes plus <span class="bold"><strong>bytes</strong></span>. Attempts to allocate new pages in the 44 file after the limit has been reached will fail. 45 </p> 46 <p> 47 To set the maximum file size for a particular database, call the 48 <code class="methodname">DbMpoolFile::set_maxsize()</code> method using the 49 <a class="link" href="memp.html" title="Chapter 9. The DbMpoolFile Handle">DbMpoolFile</a> handle stored 50 in the <span class="bold"><strong>mpf</strong></span> field of the 51 <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> handle. Attempts to insert 52 new items into the database after the limit has been reached may fail. 53 </p> 54 <p> 55 The <code class="methodname">DbMpoolFile::set_maxsize()</code> method configures a file in the 56 cache, not only operations performed using the specified 57 <a class="link" href="memp.html" title="Chapter 9. The DbMpoolFile Handle">DbMpoolFile</a> handle. 58 </p> 59 <p> 60 The <code class="methodname">DbMpoolFile::set_maxsize()</code> method may be called at any time 61 during the life of the application. 62 </p> 63 <p> 64 The <code class="methodname">DbMpoolFile::set_maxsize()</code> <span> 65 66 <span> 67 method either returns a non-zero error value or throws an 68 exception that encapsulates a non-zero error value on 69 failure, and returns 0 on success. 70 </span> 71 </span> 72 </p> 73 <div class="sect2" lang="en" xml:lang="en"> 74 <div class="titlepage"> 75 <div> 76 <div> 77 <h3 class="title"><a id="id1697409"></a>Parameters</h3> 78 </div> 79 </div> 80 </div> 81 <div class="sect3" lang="en" xml:lang="en"> 82 <div class="titlepage"> 83 <div> 84 <div> 85 <h4 class="title"><a id="id1697349"></a>bytes</h4> 86 </div> 87 </div> 88 </div> 89 <p> 90 The maximum size of the file is set to <span class="bold"><strong>gbytes</strong></span> gigabytes plus <span class="bold"><strong>bytes</strong></span>. 91 </p> 92 </div> 93 <div class="sect3" lang="en" xml:lang="en"> 94 <div class="titlepage"> 95 <div> 96 <div> 97 <h4 class="title"><a id="id1697286"></a>gbytes</h4> 98 </div> 99 </div> 100 </div> 101 <p> 102 The maximum size of the file is set to <span class="bold"><strong>gbytes</strong></span> gigabytes plus <span class="bold"><strong>bytes</strong></span>. 103 </p> 104 </div> 105 </div> 106 <div class="sect2" lang="en" xml:lang="en"> 107 <div class="titlepage"> 108 <div> 109 <div> 110 <h3 class="title"><a id="id1697494"></a>Class</h3> 111 </div> 112 </div> 113 </div> 114 <p> 115 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a>, <a class="link" href="memp.html" title="Chapter 9. The DbMpoolFile Handle">DbMpoolFile</a> 116 </p> 117 </div> 118 <div class="sect2" lang="en" xml:lang="en"> 119 <div class="titlepage"> 120 <div> 121 <div> 122 <h3 class="title"><a id="id1697442"></a>See Also</h3> 123 </div> 124 </div> 125 </div> 126 <p> 127 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 128 </p> 129 </div> 130 </div> 131 <div class="navfooter"> 132 <hr /> 133 <table width="100%" summary="Navigation footer"> 134 <tr> 135 <td width="40%" align="left"><a accesskey="p" href="mempset_lsn_offset.html">Prev</a> </td> 136 <td width="20%" align="center"> 137 <a accesskey="u" href="memp.html">Up</a> 138 </td> 139 <td width="40%" align="right"> <a accesskey="n" href="mempset_pgcookie.html">Next</a></td> 140 </tr> 141 <tr> 142 <td width="40%" align="left" valign="top">DbMpoolFile::set_lsn_offset() </td> 143 <td width="20%" align="center"> 144 <a accesskey="h" href="index.html">Home</a> 145 </td> 146 <td width="40%" align="right" valign="top"> DbMpoolFile::set_pgcookie()</td> 147 </tr> 148 </table> 149 </div> 150 </body> 151</html> 152