Since version 6.3, db4o provides an activation framework as described here.
However, this framework requires for each object to implement an additional interface plus an Activator field, and then call activate on the Activator when you need to access the content of the object.
More recently, the activation has been generalized into http://developer.db4o.com/Resources/view.aspx/Reference/Object_Lifecycle/Transparent_Persistence/Transparent_Persistence_Implementation. This enables to transparently store objects into db4o.
Configuration configuration = Db4o.newConfiguration(); configuration.add(ProxyActivationSupport.create());
By default, there is no persistence policy configured and the default activation activates on all methods.
Configuration configuration = Db4o.newConfiguration(); configuration.add(ProxyActivationSupport.create().withActivationPolicy(new ActivateOnAllMethods()).withPersistPolicy(new AnnotationPersistencePolicy()).threadLocalActivator());
The persistence policy will persist after a call on a method with the @Persist annotation.