1
<!--$Id: txn_checkpoint.so,v 10.28 2001/04/02 20:10:09 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
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,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>DbEnv.txn_checkpoint</h1>
17
<a href="../api_java/java_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
22
import com.sleepycat.db.*;
25
public int txn_checkpoint(int kbyte, int min, int flags)
29
<p>The DbEnv.txn_checkpoint method flushes the underlying memory pool,
30
writes a checkpoint record to the log, and then flushes the log.
31
<p>If either <b>kbyte</b> or <b>min</b> is non-zero, the checkpoint is
32
done only if there has been activity since the last checkpoint, and
33
either more than <b>min</b> minutes have passed since the last
34
checkpoint or if more than <b>kbyte</b> kilobytes of log data have been
35
written since the last checkpoint.
36
<p>The <b>flags</b> value must be set to 0 or
39
<p><dt><a name="Db.DB_FORCE">Db.DB_FORCE</a><dd>Force a checkpoint record, even if there has been no activity since the
42
<p>The DbEnv.txn_checkpoint method throws an exception that encapsulates a non-zero error value on
43
failure, and returns <a href="../api_c/memp_fsync.html#DB_INCOMPLETE">Db.DB_INCOMPLETE</a> if there were pages that needed to be
44
written to complete the checkpoint but that <a href="../api_java/memp_sync.html">DbEnv.memp_sync</a> was unable
47
<p>The DbEnv.txn_checkpoint method may fail and throw an exception encapsulating a non-zero error for the following conditions:
49
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
51
<p>The DbEnv.txn_checkpoint method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods.
52
If a catastrophic error has occurred, the DbEnv.txn_checkpoint method may fail and throw
53
a <a href="../api_java/runrec_class.html">DbRunRecoveryException</a>, in which case all subsequent Berkeley DB calls
54
will fail in the same way.
56
<a href="../api_java/dbenv_class.html">DbEnv</a>, <a href="../api_java/txn_class.html">DbTxn</a>
58
<a href="../api_java/env_set_tx_max.html">DbEnv.set_tx_max</a>,
59
<a href="../api_java/env_set_tx_timestamp.html">DbEnv.set_tx_timestamp</a>,
60
<a href="../api_java/txn_abort.html">DbTxn.abort</a>,
61
<a href="../api_java/txn_begin.html">DbEnv.txn_begin</a>,
62
<a href="../api_java/txn_checkpoint.html">DbEnv.txn_checkpoint</a>,
63
<a href="../api_java/txn_commit.html">DbTxn.commit</a>,
64
<a href="../api_java/txn_discard.html">DbTxn.discard</a>,
65
<a href="../api_java/txn_id.html">DbTxn.id</a>,
66
<a href="../api_java/txn_prepare.html">DbTxn.prepare</a>,
67
<a href="../api_java/txn_recover.html">DbEnv.txn_recover</a>,
69
<a href="../api_java/txn_stat.html">DbEnv.txn_stat</a>.
71
<table width="100%"><tr><td><br></td><td align=right>
72
<a href="../api_java/java_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
74
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>