head 1.2; access; symbols RPM_4_2_1:1.1.1.5 RPM_4_2:1.1.1.5 RPM_4_1_1:1.1.1.5 RPM_4_1:1.1.1.4 RPM_4_0_5:1.1.1.3 RPM_4_0_4:1.1.1.2 RPM_4_0_3:1.1.1.1 RPM:1.1.1; locks; strict; comment @# @; 1.2 date 2008.01.02.09.55.58; author rse; state dead; branches; next 1.1; commitid z4cpSiAhOCXk5PLs; 1.1 date 2001.07.23.20.45.38; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.07.23.20.45.38; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2002.01.08.00.30.12; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2003.01.18.13.49.04; author rse; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 2001.05.13.19.58.47; author rse; state Exp; branches; next 1.1.1.5; 1.1.1.5 date 2003.01.18.14.05.00; author rse; state Exp; branches; next ; desc @@ 1.2 log @remove the ancient RPM 4.2.1 source tree copy @ text @ Berkeley DB Reference Guide: Release 3.0: the DbEnv class for C++ and Java

Berkeley DB Reference Guide:
Upgrading Berkeley DB Applications

PrevRefNext

Release 3.0: the DbEnv class for C++ and Java

The DbEnv::appinit() method and two constructors for the DbEnv class are gone. There is now a single way to create and initialize the environment. The way to create an environment is to use the new DbEnv constructor with one argument. After this call, the DbEnv can be configured with various set_XXX methods. Finally, a call to DbEnv::open is made to initialize the environment.

Here's a C++ example creating a Berkeley DB environment using the 2.X interface

int dberr;
DbEnv *dbenv = new DbEnv();

dbenv->set_error_stream(&cerr); dbenv->set_errpfx("myprog");

if ((dberr = dbenv->appinit("/database/home", NULL, DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL)) != 0) { cerr << "failure: " << strerror(dberr); exit (1); }

In the Berkeley DB 3.0 release, this code would be written as:

int dberr;
DbEnv *dbenv = new DbEnv(0);

dbenv->set_error_stream(&cerr); dbenv->set_errpfx("myprog");

if ((dberr = dbenv->open("/database/home", NULL, DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL, 0)) != 0) { cerr << "failure: " << dbenv->strerror(dberr); exit (1); }

Here's a Java example creating a Berkeley DB environment using the 2.X interface:

int dberr;
DbEnv dbenv = new DbEnv();

dbenv.set_error_stream(System.err); dbenv.set_errpfx("myprog");

dbenv.appinit("/database/home", null, Db.DB_CREATE | Db.DB_INIT_LOCK | Db.DB_INIT_MPOOL);

In the Berkeley DB 3.0 release, this code would be written as:

int dberr;
DbEnv dbenv = new DbEnv(0);

dbenv.set_error_stream(System.err); dbenv.set_errpfx("myprog");

dbenv.open("/database/home", null, Db.DB_CREATE | Db.DB_INIT_LOCK | Db.DB_INIT_MPOOL, 0);

In the Berkeley DB 2.X release, DbEnv had accessors to obtain "managers" of type DbTxnMgr, DbMpool, DbLog, DbTxnMgr. If you used any of these managers, all their methods are now found directly in the DbEnv class.

PrevRefNext

Copyright Sleepycat Software @ 1.1 log @Initial revision @ text @d1 1 a1 1 @ 1.1.1.1 log @Import: RPM 4.0.3 @ text @@ 1.1.1.2 log @Import: RPM 4.0.4 @ text @d1 1 a1 1 @ 1.1.1.3 log @Import: RPM 4.0.5 @ text @d2 1 a2 1 a3 1 @ 1.1.1.4 log @Import: RPM 4.1 @ text @d2 1 a2 1 d4 1 @ 1.1.1.5 log @Import: RPM 4.1.1 @ text @d2 1 a2 1 a3 1 @