References to the DB_ENV structure are maintained by Berkeley DB, so it may not be discarded until the last close function, corresponding to an open function for which it was an argument, has returned. To ensure compatibility with future releases of Berkeley DB, all fields of the DB_ENV structure that are not explicitly set should be initialized to 0 before the first time the structure is used. Do this by declaring the structure external or static, or by calling one of the C library routines bzero(3) or memset(3).
The fields of the DB_ENV structure used by db_open are described below. If dbenv is NULL or any of its fields are set to 0, defaults appropriate for the system are used where possible.
The following fields in the DB_ENV structure may be initialized before calling db_open:
If both locking and transactions are being performed (i.e., both
lk_info and tx_info are non-NULL), the transaction
ID will be used as the locker ID.
If only locking is being performed, db_open will acquire a
locker ID from lock_id and will use it for all locks required
for this instance of db_open.
When the access methods are used in conjunction with transactions,
the application must abort the transaction (using txn_abort)
if any of the transaction protected access method calls (i.e.,
any calls other than open, close and sync) returns a
system error
(e.g., deadlock, which returns EAGAIN).