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>DbEnv::memp_sync()</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="mempstat_print.html" title="DbEnv::memp_stat_print()" /> 12 <link rel="next" href="memptrickle.html" title="DbEnv::memp_trickle()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::memp_sync()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempstat_print.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="memptrickle.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="mempsync"></a>DbEnv::memp_sync()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::memp_sync(DbLsn *lsn);</pre> 42 <p> 43 The <code class="methodname">DbEnv::memp_sync()</code> method flushes modified pages in the cache to 44 their backing files. 45 </p> 46 <p> 47 Pages in the cache that cannot be immediately written back to disk (for 48 example, pages that are currently in use by another thread of control) 49 are waited for and written to disk as soon as it is possible to do so. 50 </p> 51 <p> 52 The <code class="methodname">DbEnv::memp_sync()</code> <span> 53 54 <span> 55 method either returns a non-zero error value or throws an 56 exception that encapsulates a non-zero error value on 57 failure, and returns 0 on success. 58 </span> 59 </span> 60 </p> 61 <div class="sect2" lang="en" xml:lang="en"> 62 <div class="titlepage"> 63 <div> 64 <div> 65 <h3 class="title"><a id="id1691996"></a>Parameters</h3> 66 </div> 67 </div> 68 </div> 69 <div class="sect3" lang="en" xml:lang="en"> 70 <div class="titlepage"> 71 <div> 72 <div> 73 <h4 class="title"><a id="id1692128"></a>lsn</h4> 74 </div> 75 </div> 76 </div> 77 <p> 78 The purpose of the <span class="bold"><strong>lsn</strong></span> parameter is 79 to enable a transaction manager to ensure, as part of a checkpoint, 80 that all pages modified by a certain time have been written to disk. 81 </p> 82 <p> 83 All modified pages with a a log sequence number 84 (<a class="link" href="lsn.html" title="Chapter 8. The DbLsn Handle">DbLsn</a>) less than the <span class="bold"><strong>lsn</strong></span> parameter are written to disk. If 85 <span class="bold"><strong>lsn</strong></span> is NULL, all modified pages in 86 the cache are written to disk. 87 </p> 88 </div> 89 </div> 90 <div class="sect2" lang="en" xml:lang="en"> 91 <div class="titlepage"> 92 <div> 93 <div> 94 <h3 class="title"><a id="id1692294"></a>Class</h3> 95 </div> 96 </div> 97 </div> 98 <p> 99 <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> 100 </p> 101 </div> 102 <div class="sect2" lang="en" xml:lang="en"> 103 <div class="titlepage"> 104 <div> 105 <div> 106 <h3 class="title"><a id="id1692346"></a>See Also</h3> 107 </div> 108 </div> 109 </div> 110 <p> 111 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 112 </p> 113 </div> 114 </div> 115 <div class="navfooter"> 116 <hr /> 117 <table width="100%" summary="Navigation footer"> 118 <tr> 119 <td width="40%" align="left"><a accesskey="p" href="mempstat_print.html">Prev</a> </td> 120 <td width="20%" align="center"> 121 <a accesskey="u" href="memp.html">Up</a> 122 </td> 123 <td width="40%" align="right"> <a accesskey="n" href="memptrickle.html">Next</a></td> 124 </tr> 125 <tr> 126 <td width="40%" align="left" valign="top">DbEnv::memp_stat_print() </td> 127 <td width="20%" align="center"> 128 <a accesskey="h" href="index.html">Home</a> 129 </td> 130 <td width="40%" align="right" valign="top"> DbEnv::memp_trickle()</td> 131 </tr> 132 </table> 133 </div> 134 </body> 135</html> 136