1<!--$Id: txn_checkpoint.so,v 10.49 2005/03/02 22:57:15 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: DbEnv::txn_checkpoint</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>DbEnv::txn_checkpoint</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 &lt;db_cxx.h&gt;
23<p>
24int
25DbEnv::txn_checkpoint(u_int32_t kbyte, u_int32_t min, u_int32_t flags) const;
26</pre></b>
27<hr size=1 noshade>
28<b>Description: DbEnv::txn_checkpoint</b>
29<p>If there has been any logging activity in the database environment since
30the last checkpoint, the DbEnv::txn_checkpoint method flushes the underlying
31memory pool, writes a checkpoint record to the log, and then flushes the
32log.</p>
33<p>The DbEnv::txn_checkpoint method
34either returns a non-zero error value
35or throws an exception that encapsulates a non-zero error value on
36failure, and returns 0 on success.
37</p>
38<b>Parameters</b> <br>
39 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to 0 or
40the following value:
41<br>
42<b><a name="DB_FORCE">DB_FORCE</a></b><ul compact><li>Force a checkpoint record, even if there has been no activity since the
43last checkpoint.</ul>
44<br></ul>
45 <b>kbyte</b><ul compact><li>If the <b>kbyte</b> parameter is non-zero, a checkpoint will be done
46if more than <b>kbyte</b> kilobytes of log data have been written since
47the last checkpoint.</ul>
48 <b>min</b><ul compact><li>If the <b>min</b> parameter is non-zero, a checkpoint will be done if
49more than <b>min</b> minutes have passed since the last checkpoint.</ul>
50<br>
51<br><b>Errors</b>
52<p>The DbEnv::txn_checkpoint method
53may fail and throw
54<a href="../api_cxx/except_class.html">DbException</a>,
55encapsulating one of the following non-zero errors, or return one of
56the following non-zero errors:</p>
57<br>
58<b>EINVAL</b><ul compact><li>An
59invalid flag value or parameter was specified.</ul>
60<br>
61<hr size=1 noshade>
62<br><b>Class</b>
63<a href="../api_cxx/env_class.html">DbEnv</a>, <a href="../api_cxx/txn_class.html">DbTxn</a>
64<br><b>See Also</b>
65<a href="../api_cxx/txn_list.html">Transaction Subsystem and Related Methods</a>
66</tt>
67<table width="100%"><tr><td><br></td><td align=right>
68<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>
69</td></tr></table>
70<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
71</body>
72</html>
73