The Berkeley DB interfaces have been reworked in the 3.0.55 release
for two reasons. The goals were as follows: to make the Berkeley DB
structures opaque so future releases of Berkeley DB can be binary
compatible with each other, provide enhanced error checking and reporting
during Berkeley DB environment and database configuration and creation,
provide configurability throughout the lifetime of the environment and
database, and to make the Berkeley DB interfaces consistent across the
C++, C and Java APIs.
While the C API changes are extensive, they are also simple to understand.
No functionality was removed. The changes required comparatively few
modifications to the C++ and Java APIs, mostly limited to moving methods
among classes and the addition of a new flag value to a few interfaces.
For specific instructions on upgrading Berkeley DB 2.X applications to
this release, see the "Upgrading Berkeley DB 2.X.X applications to
Berkeley DB 3.0" chapter in the Berkeley DB Reference Guide.
The following individual changes are all part of this larger change.
Function changes:
- The db_appinit and db_appexit functions have been replaced by the
db_env_create function and the DBENV->open and DBENV->close methods. The
db_open function has been removed, replaced by the db_create function and
the DB->open method. Berkeley DB environments are now created using the
db_env_create function followed by methods on the handle it returns.
Berkeley DB databases are now created using the db_create function
followed by methods on the handle it returns.
- The lock_open, lock_close and lock_unlink functions have been
replaced by the db_env_create function and the DBENV->open, DBENV->close
and DBENV->remove methods. The remaining lock subsystem functions now
take a DBENV handle as their first argument instead of a DB_LOCKTAB
handle.
- The log_open, log_close and log_unlink functions have been replaced
by the db_env_create function and the DBENV->open, DBENV->close and
DBENV->remove methods. The remaining log subsystem functions now take a
DBENV handle as their first argument instead of a DB_LOG handle.
- The memp_open, memp_close and memp_unlink functions have been replaced
by the db_env_create function and the DBENV->open, DBENV->close and
DBENV->remove methods. The remaining shared memory buffer pool functions
now take a DBENV handle as their first argument instead of a DB_MPOOL
handle.
- The txn_open, txn_close and txn_unlink functions have been replaced
by the db_env_create function and the DBENV->open, DBENV->close and
DBENV->remove methods. The remaining transaction subsystem functions now
take a DBENV handle as their first argument instead of a DB_TXNMGR handle.
- The db_jump_set and db_value_set functions have been replaced by
methods on the DBENV handle.
- The db_xa_open routine has been replaced by a new flag, DB_XA_CREATE,
which is passed to the db_create function.
DBENV structure changes:
- The db_errcall, db_errfile, db_errpfx and db_paniccall fields of the
DBENV structure have been deprecated and their functionality replaced by
the DBENV->set_errcall, DBENV->set_errfile, DBENV->set_errpfx and
DBENV->set_paniccall methods.
- The db_verbose field of the DBENV structure has been replaced by the
DBENV->set_verbose method.
- The lk_conflicts, lk_detect, lk_max and lk_modes fields of the DBENV
structure have been replaced by the DBENV->set_lk_conflicts,
DBENV->set_lk_detect and DBENV->set_lk_max methods.
- The lg_max field of the DBENV structure has been replaced by the
DBENV->set_lg_max method.
- The mp_mmapsize and mp_size fields of the DBENV structure have been
replaced by the DBENV->set_cachesize and DBENV->set_mp_mmapsize methods.
- The tx_info, tx_max and tx_recover fields of the DBENV structure have
been replaced by the DBENV->set_tx_max and DBENV->set_tx_recover methods.
- The (unused) DBENV->db_lorder field has been deleted.
DB structure changes:
- The byteswapped field of the DB structure has been replaced by the
DB->get_byteswapped method.
- The db_errcall, db_errfile, db_errpfx and db_paniccall fields of the
DB structure have been deprecated and their functionality replaced by the
DB->set_errcall, DB->set_errfile, DB->set_errpfx and DB->set_paniccall
methods.
- The type field of the DB structure has been replaced by the
DB->get_type method.
DBINFO structure changes:
- The bt_compare field of the DB structure has been replaced by the
DB->set_bt_compare method.
- The bt_minkey field of the DB structure has been replaced by the
DB->set_bt_minkey method.
- The bt_prefix field of the DB structure has been replaced by the
DB->set_bt_prefix method.
- The db_cachesize field of the DB structure has been replaced by the
DB->set_cachesize method.
- The db_lorder field of the DB structure has been replaced by the
DB->set_lorder method.
- The db_malloc field of the DB structure has been replaced by the
DB->set_malloc method.
- The db_pagesize field of the DB structure has been replaced by the
DB->set_pagesize method.
- The dup_compare field of the DB structure has been replaced by the
DB->set_dupcompare method.
- The flags field of the DB structure has been replaced by the
DB->set_flags method.
- The h_ffactor field of the DB structure has been replaced by the
DB->set_h_ffactor method.
- The h_hash field of the DB structure has been replaced by the
DB->set_h_hash method.
- The h_nelem field of the DB structure has been replaced by the
DB->set_h_nelem method.
- The re_delim field of the DB structure has been replaced by the
DB->set_re_delim method.
- The re_len field of the DB structure has been replaced by the
DB->set_re_len method.
- The re_pad field of the DB structure has been replaced by the
DB->set_re_pad method.
- The re_source field of the DB structure has been replaced by the
DB->set_re_source method.