db4o |

# ObjectContainer.activate Method

activates all members on a stored object to the specified depth.

void activate(
object obj,
int depth
);

#### Parameters

obj
  the object to be activated.
depth
  the member activationDepth to which activate is to cascade.

#### Remarks

activates all members on a stored object to the specified depth.
See activationDepth for an explanation why activation is necessary.
The activate method activates a graph of persistent objects in memory. Only deactivated objects in the graph will be touched: their fields will be loaded from the database. The activate methods starts from a root object and traverses all member objects to the depth specified by the depth parameter. The depth parameter is the distance in "field hops" (object.field.field) away from the root object. The nodes at 'depth' level away from the root (for a depth of 3: object.member.member) will be instantiated but deactivated, their fields will be null. The activation depth of individual classes can be overruled with the methods maximumActivationDepth and minimumActivationDepth in the ObjectClass interface .
A successful call to activate triggers the callback method objectOnActivate which can be used for cascaded activation.

#### See Also

ObjectContainer Interface | com.db4o Namespace | activationDepth | Using callbacks