Initialise a DB environment. The predicate bdb_init/1
initialises the default environment, while bdb_init/2 creates
an explicit environment that can be passed to bdb_open/4 using
environment(+Environment) option. If bdb_init/1 is called,
it must be called before the first call to bdb_open/4 that uses
the default environment. If bdb_init/1 is not called, the
default environment can only handle plain files and does not
support multiple threads, locking, crash recovery, etc.
Initializing a BDB environment always requires the
option. If the environment contains no databases, the argument
create(true) must be supplied as well.
The currently supported options are listed below. The name of
the boolean options are derived from the DB flags by dropping
the =DB_= prefix and using lowercase, e.g.
init_lock. For details, please refer to the DB manual.
true, create any underlying file as required. By
default, no new files are created. This option should be
set for prograns that create new databases.
- Specify the DB home directory, the directory holding the
database files. The directory must exist prior to calling
- Enable locking (
DB_INIT_LOCK). Implied if transactions
- Enable logging the DB modifications (
enables recovery of databases in case of system failure.
Normally it is used in combination with transactions.
- Initialize memory pool. Impicit if
mp_mmapsize(+Size) is specified.
- Init database replication. The rest of the replication
logic is not yet supported.
- Init transactions. Implies
- Control memory pool handling (
mp_size option sets the memory-pool used for
caching, while the
mp_mmapsize controls the maximum size
of a DB file mapped entirely into memory.
- Perform recovery before opening the database.
- Perform fatal recovery before opening the database.
- Initialise the DB package for accessing a remote
database. Host specifies the name of the machine running
berkeley_db_svc. Optionally additional options may be
- Specify the timeout time the server uses to determine
that the client has gone. This implies the server will
terminate the connection to this client if this client
does not issue any requests for the indicated time.
- Specify the time the client waits for the server to
handle a request.
- Enable transactions, providing atomicy of changes and
security. Implies logging and locking. See
- Make the environment accessible from multiple threads.
- Declare an approximate number of threads in the database
- Specify a list of configuration options, each option is of
the form Name(Value). Currently unused.