You are here: Tuning > Performance Hints > Commit Strategies

Commit Strategies

.NET:

objectContainer.Commit();

Objects created or instantiated within one db4o transaction are written to a temporary transaction area in the database file and are only durable after the transaction is committed.

Transactions are committed implicitly when the object container is closed.

.NET:

objectContainer.Close();

Advantage

Committing a transaction makes sure that all the changes are effectively written to a storage location. Commit uses a special sequence of actions, which ensures ACID transactions. The following operations are done during commit:

Effect

Commit is a costly operation as it includes disk writes and flushes of the operating system disk cache. Too many commits can decrease your application's performance. On the other hand long transaction increases the risk of loosing your data in case of a system or a hardware failure.

Best Strategies