Java:
configuration.activationDepth(activationDepth)
configures global activation depth, which will be used for all objects instead of the default value. This method should be called before opening a database file.
Java:
configuration.activationDepth(activationDepth)
has a similar effect, but the setting will be applied to the specific ObjectContainer and can be changed for the open database file.
01private static void testActivationConfig(){ 02
storeSensorPanel(); 03
Configuration configuration = Db4o.newConfiguration(); 04
configuration.activationDepth(1); 05
ObjectContainer container = Db4o.openFile(configuration, DB4O_FILE_NAME); 06
try { 07
System.out.println("Object container activation depth = 1"); 08
ObjectSet result = container.get(new SensorPanel(1)); 09
listResult(result); 10
if (result.size() >0) { 11
SensorPanel sensor = (SensorPanel)result.get(0); 12
SensorPanel next = sensor.next; 13
while (next != null){ 14
System.out.println(next); 15
next = next.next; 16
} 17
} 18
} finally { 19
container.close(); 20
} 21
}
By configuring db4o you can have full control over activation behavior. The two extremes: