db4o

Configuration.activationDepth Method 

sets the activation depth to the specified value.

[Visual Basic]
Sub activationDepth( _ 
   ByVal depth As Integer _ 
)
[C#]
void activationDepth(
   int depth
);
[C++]
void activationDepth(
   int depth
);
[JScript]
function activationDepth(
   int depth
);

Parameters

depth
the desired global activation depth.

Remarks

sets the activation depth to the specified value.

Why activation?
During the instantiation of stored objects from persistent storage, the instantiation of members needs to be limited to a certain depth. Otherwise a possible root object would completely instantiate all stored objects to memory.

db4o uses a preconfigured "activation depth" of 5.

If an object is returned in an ObjectSet as a result of a query

object.member1.member2.member3.member4.member5
will be instantiated. member5 will have all it's members set to null. Primitive types will have the default values respectively. In db4o terminology, the state of member5 is called
DEACTIVATED
. member5 can be activated by calling ObjectContainer#activate(member5, depth) .

Note that raising the global activation depth will consume more memory and have negative effects on the performance of first-time retrievals. Lowering the global activation depth needs more individual activation work but can increase performance of queries.

ObjectContainer#deactivate(Object, depth) can be used to manually free memory by deactivating objects.

Examples: ../com/db4o/samples/activate.

See Also

Configuration Interface | com.db4o.config Namespace | configuring classes individually