Berkeley DB: DbEnv.txn_checkpoint
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++

# DbEnv.txn_checkpoint |

`

###

    import com.sleepycat.db.*;

    int
    public void txn_checkpoint(int kbyte, int min)
    	throws DbException;

# Description

The DbEnv.txn_checkpoint method flushes the underlying memory pool, writes a checkpoint record to the log and then flushes the log.

If either kbyte or min is non-zero, the checkpoint is only done if more than min minutes have passed since the last checkpoint, or if more than kbyte kilobytes of log data have been written since the last checkpoint.

The DbEnv.txn_checkpoint method throws an exception that encapsulates a non-zero error value on failure,and returns Db.DB_INCOMPLETE if there were pages that needed to be written but that DbEnv.memp_sync was unable to write immediately. In this case, the DbEnv.txn_checkpoint call should be retried.

# Errors

If a fatal error occurs in Berkeley DB, the DbEnv.txn_checkpoint method will fail and throw a DbRunRecoveryException, at which point all subsequent database calls will fail in the same way.

In addition, the DbEnv.txn_checkpoint method may fail and throw an exception encapsulating a non-zero error for the following conditions:

EINVAL
  An invalid flag value or parameter was specified.

In addition, the DbEnv.txn_checkpoint method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods.

### Classes

DbEnv, DbTxn

# See Also

DbEnv.set_tx_max, DbTxn.abort, DbEnv.txn_begin, DbEnv.txn_checkpoint, DbTxn.commit, DbTxn.id, DbTxn.prepare and DbEnv.txn_stat.`

Copyright Sleepycat Software