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: DB_ENV->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>DB_ENV->txn_checkpoint</b> 14</td> 15<td align=right> 16<a href="../api_c/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.h> 23<p> 24int 25DB_ENV->txn_checkpoint(const DB_ENV *env, 26 u_int32_t kbyte, u_int32_t min, u_int32_t flags); 27</pre></b> 28<hr size=1 noshade> 29<b>Description: DB_ENV->txn_checkpoint</b> 30<p>If there has been any logging activity in the database environment since 31the last checkpoint, the DB_ENV->txn_checkpoint method flushes the underlying 32memory pool, writes a checkpoint record to the log, and then flushes the 33log.</p> 34<p>The DB_ENV->txn_checkpoint method 35returns a non-zero error value on failure 36and 0 on success. 37</p> 38<p>The DB_ENV->txn_checkpoint method is the underlying method used by the <a href="../utility/db_checkpoint.html">db_checkpoint</a> utility. 39See the <a href="../utility/db_checkpoint.html">db_checkpoint</a> utility source code for an example of using DB_ENV->txn_checkpoint 40in a IEEE/ANSI Std 1003.1 (POSIX) environment.</p> 41<b>Parameters</b> <br> 42 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to 0 or 43the following value: 44<br> 45<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 46last checkpoint.</ul> 47<br></ul> 48 <b>kbyte</b><ul compact><li>If the <b>kbyte</b> parameter is non-zero, a checkpoint will be done 49if more than <b>kbyte</b> kilobytes of log data have been written since 50the last checkpoint.</ul> 51 <b>min</b><ul compact><li>If the <b>min</b> parameter is non-zero, a checkpoint will be done if 52more than <b>min</b> minutes have passed since the last checkpoint.</ul> 53<br> 54<br><b>Errors</b> 55<p>The DB_ENV->txn_checkpoint method 56may fail and return one of the 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_c/env_class.html">DB_ENV</a>, <a href="../api_c/txn_class.html">DB_TXN</a> 64<br><b>See Also</b> 65<a href="../api_c/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_c/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