1
2
3This is the mod_db4 apache module, providing a safe framework
4for running db4 applications in the Apache 1.3 environment. In
5general, it is dangerous to run db4 in a multi-process system
6without some facility to coordinate recovery between 
7participating processes. Apache natively provides no
8interface for commuication between processes, so the mod_db4 
9module exists to provide this communication.
10
11Specifically, mod_db4 provides the following facilities:
12
13o New constructors for DB and DB_ENV structures, which install
14replacement open/close methods.
15o Transparent caching of open DB and DB_ENV structures
16o Reference counting on all structures, allowing the module to
17detect the initial opening of any managed database
18and automatically perform recovery.
19o Automatic detection of unexpected failures (segfaults, or a
20module actually calling exit() and avoiding shutdown phases,
21and automatic termination of all child processes with open 
22database resources to attempt consistency.
23
24mod_db4 is designed to be used as an alternative interface to db4.
25To have another Apache module (for example, mod_foo) use mod_db4, 
26do not link mod_foo against libdb-4.2.  In your mod_foo makefile,
27you should 
28
29#include "mod_db4_export.h"
30
31and add your Apache include directory to your CPPFLAGS.
32
33In mod_foo, to create a mod_db4 managed DB_ENV, use the following:
34
35int mod_db4_db_env_create(DB_ENV **dbenvp, u_int32_t flags);
36
37which takes identical arguments to db_env_create().
38
39To create a mod_db4 managed DB, use
40
41int mod_db4_db_create(DB **dbp, DB_ENV *dbenv, u_int32_t flags);
42
43which takes identical arguments to db_create().
44
45Otherwise the API is completely consistent with the standard Berkeley
46DB API.
47
48For installation instructions, see the INSTALL file.
49