• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/db-4.8.30/docs/api_reference/CXX/
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::txn_checkpoint()</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="txn.html" title="Chapter 13.  The DbTxn Handle" />
11    <link rel="prev" href="txnbegin.html" title="DbEnv::txn_begin()" />
12    <link rel="next" href="txncommit.html" title="DbTxn::commit()" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">DbEnv::txn_checkpoint()</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="txnbegin.html">Prev</a> </td>
22          <th width="60%" align="center">Chapter 13. 
23                The DbTxn Handle 
24        </th>
25          <td width="20%" align="right"> <a accesskey="n" href="txncommit.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="txncheckpoint"></a>DbEnv::txn_checkpoint()</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">#include &lt;db_cxx.h&gt;
39 
40int
41DbEnv::txn_checkpoint(u_int32_t kbyte, u_int32_t min, u_int32_t flags) const;</pre>
42      <p>
43         If there has been any logging activity in the database environment
44         since the last checkpoint, the <code class="methodname">DbEnv::txn_checkpoint()</code> method
45         flushes the underlying memory pool, writes a checkpoint record to the
46         log, and then flushes the log.
47    </p>
48      <p>
49         The <code class="methodname">DbEnv::txn_checkpoint()</code> method returns a non-zero error value on
50         failure and 0 on success.
51    </p>
52      <p>
53         The <code class="methodname">DbEnv::txn_checkpoint()</code> method is the underlying method used by
54         the <a class="link" href="db_checkpoint.html" title="db_checkpoint">db_checkpoint</a>
55         utility. See the <a class="link" href="db_checkpoint.html" title="db_checkpoint">db_checkpoint</a> utility
56         source code for an example of using <code class="methodname">DbEnv::txn_checkpoint()</code> in a
57         IEEE/ANSI Std 1003.1 (POSIX) environment.
58    </p>
59      <div class="sect2" lang="en" xml:lang="en">
60        <div class="titlepage">
61          <div>
62            <div>
63              <h3 class="title"><a id="id1713916"></a>Parameters</h3>
64            </div>
65          </div>
66        </div>
67        <div class="sect3" lang="en" xml:lang="en">
68          <div class="titlepage">
69            <div>
70              <div>
71                <h4 class="title"><a id="id1713572"></a>flags</h4>
72              </div>
73            </div>
74          </div>
75          <p>
76                          The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
77                          or the following value:
78                     </p>
79          <div class="itemizedlist">
80            <ul type="disc">
81              <li>
82                <p>
83                  <code class="literal">DB_FORCE</code>
84            </p>
85                <p>
86                 Force a checkpoint record, even if there has been no activity since
87                 the last checkpoint.
88            </p>
89              </li>
90            </ul>
91          </div>
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="id1714256"></a>kbyte</h4>
98              </div>
99            </div>
100          </div>
101          <p>
102                          If the <span class="bold"><strong>kbyte</strong></span> parameter is non-zero, a
103                          checkpoint will be done if more than <span class="bold"><strong>kbyte</strong></span> kilobytes of log data have been written
104                          since the last checkpoint.
105                     </p>
106        </div>
107        <div class="sect3" lang="en" xml:lang="en">
108          <div class="titlepage">
109            <div>
110              <div>
111                <h4 class="title"><a id="id1714393"></a>min</h4>
112              </div>
113            </div>
114          </div>
115          <p>
116                          If the <span class="bold"><strong>min</strong></span> parameter is non-zero, a
117                          checkpoint will be done if more than <span class="bold"><strong>min</strong></span> minutes have passed since the last
118                          checkpoint.
119                     </p>
120        </div>
121      </div>
122      <div class="sect2" lang="en" xml:lang="en">
123        <div class="titlepage">
124          <div>
125            <div>
126              <h3 class="title"><a id="id1714245"></a>Errors</h3>
127            </div>
128          </div>
129        </div>
130        <p>
131                         The <code class="methodname">DbEnv::txn_checkpoint()</code> <span>
132            
133            <span>
134                method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 
135                exception, encapsulating one of the following non-zero errors, or return one
136                of the following non-zero errors:
137            </span>
138        </span>
139                    </p>
140        <div class="sect3" lang="en" xml:lang="en">
141          <div class="titlepage">
142            <div>
143              <div>
144                <h4 class="title"><a id="id1713834"></a>EINVAL</h4>
145              </div>
146            </div>
147          </div>
148          <p>
149                An invalid flag value or parameter was specified.
150            </p>
151        </div>
152      </div>
153      <div class="sect2" lang="en" xml:lang="en">
154        <div class="titlepage">
155          <div>
156            <div>
157              <h3 class="title"><a id="id1714181"></a>Class</h3>
158            </div>
159          </div>
160        </div>
161        <p>
162                 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>, <a class="link" href="txn.html" title="Chapter 13.  The DbTxn Handle">DbTxn</a> 
163            </p>
164      </div>
165      <div class="sect2" lang="en" xml:lang="en">
166        <div class="titlepage">
167          <div>
168            <div>
169              <h3 class="title"><a id="id1714170"></a>See Also</h3>
170            </div>
171          </div>
172        </div>
173        <p>
174                     <a class="xref" href="txn.html#txnlist" title="Transaction Subsystem and Related Methods">Transaction Subsystem and Related Methods</a> 
175                </p>
176      </div>
177    </div>
178    <div class="navfooter">
179      <hr />
180      <table width="100%" summary="Navigation footer">
181        <tr>
182          <td width="40%" align="left"><a accesskey="p" href="txnbegin.html">Prev</a> </td>
183          <td width="20%" align="center">
184            <a accesskey="u" href="txn.html">Up</a>
185          </td>
186          <td width="40%" align="right"> <a accesskey="n" href="txncommit.html">Next</a></td>
187        </tr>
188        <tr>
189          <td width="40%" align="left" valign="top">DbEnv::txn_begin() </td>
190          <td width="20%" align="center">
191            <a accesskey="h" href="index.html">Home</a>
192          </td>
193          <td width="40%" align="right" valign="top"> DbTxn::commit()</td>
194        </tr>
195      </table>
196    </div>
197  </body>
198</html>
199