public interface DbAppendRecno
{
public abstract void db_append_recno(Db db, Dbt data, int recno);
throws DbException;
}
public class Db
{
public void set_append_recno(DbAppendRecno db_append_recno)
throws DbException;
...
}
Description
When using the Db.DB_APPEND option of the Db.put method,
it may be useful to modify the stored data based on the generated key.
If a callback method is specified using the
Db.set_append_recno method, it will be called after the record number
has been selected but before the data has been stored.
The callback function must throw a DbException object to
encapsulate the error on failure. That object will be thrown to
caller of Db.put.
The called function must take three arguments: a reference to the
enclosing database handle, the data Dbt to be stored and the
selected record number. The called function may then modify the data
Dbt.
The Db.set_append_recno interface may only be used to configure Berkeley DB before
the Db.open interface is called.
The Db.set_append_recno method throws an exception that encapsulates a non-zero error value on
failure.