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.

IEmbeddedConfiguration configuration = Db4oEmbedded.NewConfiguration();
configuration.Common.ActivationDepth = 2;
CommonConfigurationExamples.cs: Change activation depth
Dim configuration As IEmbeddedConfiguration = Db4oEmbedded.NewConfiguration()
configuration.Common.ActivationDepth = 2
CommonConfigurationExamples.vb: 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"

IEmbeddedConfiguration configuration = Db4oEmbedded.NewConfiguration();
configuration.Common.ObjectClass(typeof (Person)).MinimumActivationDepth(2);
ObjectConfigurationExamples.cs: Set minimum activation depth
Dim configuration As IEmbeddedConfiguration = Db4oEmbedded.NewConfiguration()
configuration.Common.ObjectClass(GetType(Person)).MinimumActivationDepth(2)
ObjectConfigurationExamples.vb: Set minimum activation depth