You are here: Configuration > Common Configuration > Activation Depth

Activation Depth

db4o uses the concept of activation to avoid loading to much data into memory. You can change the global activation depth with this setting.

Note: As soon as you use transparent activation/persistence this configuration option has no effect.

EmbeddedConfiguration configuration = Db4oEmbedded.newConfiguration();
configuration.common().activationDepth(2);
CommonConfigurationExamples.java: Change activation depth

A higher activation depth is usually more convenient to work with, because you don't face inactivated objects. However, a higher activation depth costs performance, because more data has to read from the database. Therefore a good balance need to be found. Take also a look a transparent activation, since it solves the activation issue completely.

Class Specific Configuration

You can also configure a class specific activation depth. See "Class Specific Configuration"

EmbeddedConfiguration configuration = Db4oEmbedded.newConfiguration();
configuration.common().objectClass(Person.class).minimumActivationDepth(2);
ObjectConfigurationExamples.java: Set minimum activation depth