ACID Properties For Db4o
As any
reliable database system db4o ensures ACID transactions. When a commit is
executed, the following order of disc writes is ensured:
- a list of "pointers that
are to be modified" is written to the database file;
- the database file is switched
into "in-commit" mode;
- the pointers are actually
modified in the database file;
- the database file is switched
to "not-in-commit" mode.

As you
can see from the picture above if a fatal failure occurs after the stage 1, the
database will be restored to its pre-transaction consistent state. If the
failure occurs after any other stage, the transaction information will be
available from the transaction commit record and the commit will be restarted
when the database will be open again.
The
isolation in db4o database is at degree one, which means that a transaction
does not overwrite "dirty data" of the other transactions and does not
commit any writes until it completes all its writes (transaction commit
record).
There are
2 settings that can effect ACID behavior in db4o:
-
.NET
configuration.FlushFileBuffers(false)
this setting can be potentially dangerous on systems
using in-memory file caching. Instead of carrying out all writes immediately,
the kernel stores data temporally in the buffer cache, waiting to see if it is
possible to group several writes together. Cached file changes can also be
reversed, which can break the ACID model.
-
.NET:
configuration.DisableCommitRecovery()
This setting disables commit recovery when the fatal
failure occurs on stage 2-3 of the commit process. This setting should only be
used in emergency situations after consulting db4o support. The ACID flow of
the commit can be re-enabled after restoring the original configuration.