1
<!--$Id: memp_fsync.so,v 10.25 2001/05/05 01:49:16 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB: DbMpoolFile::sync</title>
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
11
<a name="2"><!--meow--></a>
12
<table width="100%"><tr valign=top>
14
<h1>DbMpoolFile::sync</h1>
17
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
22
#include <db_cxx.h>
28
<p>The DbMpoolFile::sync method writes all pages associated with the
29
<a href="../api_cxx/mempfile_class.html">DbMpoolFile</a>, which were marked as modified using
30
<a href="../api_cxx/memp_fput.html">DbMpoolFile::put</a> or <a href="../api_cxx/memp_fset.html">DbMpoolFile::set</a>, back to the source file. If
31
any of the modified pages are also <i>pinned</i> (that is, this or
32
another process currently refers to them), DbMpoolFile::sync will
34
<p>The DbMpoolFile::sync method either returns a non-zero error value or throws an exception that
35
encapsulates a non-zero error value on failure, 0 on success, and returns <a href="../api_c/memp_fsync.html#DB_INCOMPLETE">DB_INCOMPLETE</a> if there were pages that were modified
36
but that DbMpoolFile::sync was unable to write immediately.
38
<p>The DbMpoolFile::sync method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods.
39
If a catastrophic error has occurred, the DbMpoolFile::sync method may fail and either
40
return <a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> or throw an exception encapsulating
41
<a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>, in which case all subsequent Berkeley DB calls will fail
44
<a href="../api_cxx/dbenv_class.html">DbEnv</a>, <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a>
46
<a href="../api_cxx/env_set_cachesize.html">DbEnv::set_cachesize</a>,
47
<a href="../api_cxx/env_set_mp_mmapsize.html">DbEnv::set_mp_mmapsize</a>,
48
<a href="../api_cxx/memp_fclose.html">DbMpoolFile::close</a>,
49
<a href="../api_cxx/memp_fget.html">DbMpoolFile::get</a>,
50
<a href="../api_cxx/memp_fopen.html">DbMpoolFile::open</a>,
51
<a href="../api_cxx/memp_fput.html">DbMpoolFile::put</a>,
52
<a href="../api_cxx/memp_fset.html">DbMpoolFile::set</a>,
53
<a href="../api_cxx/memp_fsync.html">DbMpoolFile::sync</a>,
54
<a href="../api_cxx/memp_register.html">DbEnv::memp_register</a>,
55
<a href="../api_cxx/memp_stat.html">DbEnv::memp_stat</a>,
56
<a href="../api_cxx/memp_sync.html">DbEnv::memp_sync</a>,
58
<a href="../api_cxx/memp_trickle.html">DbEnv::memp_trickle</a>.
60
<table width="100%"><tr><td><br></td><td align=right>
61
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
63
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>