So far, this Reference Guide has discussed how applications can use the Berkeley DB Access Methods to store and retrieve data items to and from database files. This chapter will discuss how to write applications to include transactional support. First, there are a few terms that will be helpful:
To run recovery, all applications in the environment must exit Berkeley DB. (Normally, and always, of course, in the case of system failure, the applications will stop running entirely.)
Once none of the applications are still using the database environment, recovery is performed by calling the Berkeley DB interface with special flags (either DB_RECOVER or DB_RECOVER_FATAL).
When recovery is complete, the database environment is again available for normal use.
There are a number of reasons for using transactional support in your programs. The most common are: