1<!--$Id: memp_set_flags.so,v 1.19 2007/06/07 15:30:46 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_flags</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_flags</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 <db_cxx.h> 23<p> 24int 25DbMpoolFile::set_flags(u_int32_t flags, bool onoff); 26<p> 27int 28DbMpoolFile::get_flags(u_int32_t *flagsp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbMpoolFile::set_flags</b> 32<p>Configure a file in the cache.</p> 33<p>To set the flags for a particular database, call the 34DbMpoolFile::set_flags method using the <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a> handle stored in 35the <b>mpf</b> field of the <a href="../api_cxx/db_class.html">Db</a> handle.</p> 36<p>The DbMpoolFile::set_flags method 37either returns a non-zero error value 38or throws an exception that encapsulates a non-zero error value on 39failure, and returns 0 on success. 40</p> 41<b>Parameters</b> <br> 42 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set by bitwise inclusively <b>OR</b>'ing together one or more 43of the following values: 44<br> 45<b><a name="DB_MPOOL_NOFILE">DB_MPOOL_NOFILE</a></b><ul compact><li>If set, no backing temporary file will be opened for the specified 46in-memory database, even if it expands to fill the entire cache. 47Attempts to create new database pages after the cache has been filled 48will fail. 49<p>The DB_MPOOL_NOFILE flag configures a file in the memory pool, not only 50operations performed using the specified <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a> handle.</p> 51<p>The DB_MPOOL_NOFILE flag may be used to configure Berkeley DB at any time during 52the life of the application.</p></ul> 53<b><a name="DB_MPOOL_UNLINK">DB_MPOOL_UNLINK</a></b><ul compact><li>If set, remove the file when the last reference to it is closed. 54<p>The DB_MPOOL_NOFILE flag configures a file in the memory pool, not only 55operations performed using the specified <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a> handle.</p> 56<p>The DB_MPOOL_UNLINK flag may be used to configure Berkeley DB at any time during 57the life of the application.</p></ul> 58<br></ul> 59 <b>onoff</b><ul compact><li>If <b>onoff</b> is 60false, 61the specified flags are cleared; otherwise they are set.</ul> 62<br> 63<hr size=1 noshade> 64<b>Description: DbMpoolFile::get_flags</b> 65<p>The DbMpoolFile::get_flags method returns the flags.</p> 66<p>The DbMpoolFile::get_flags method may be called at any time during the life of the 67application.</p> 68<p>The DbMpoolFile::get_flags method 69either returns a non-zero error value 70or throws an exception that encapsulates a non-zero error value on 71failure, and returns 0 on success. 72</p> 73<b>Parameters</b> <br> 74 <b>flagsp</b><ul compact><li>The DbMpoolFile::get_flags method returns the 75flags in <b>flagsp</b>.</ul> 76<br> 77<hr size=1 noshade> 78<br><b>Class</b> 79<a href="../api_cxx/env_class.html">DbEnv</a>, <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a> 80<br><b>See Also</b> 81<a href="../api_cxx/memp_list.html">Memory Pools and Related Methods</a> 82</tt> 83<table width="100%"><tr><td><br></td><td align=right> 84<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> 85</td></tr></table> 86<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 87</body> 88</html> 89