IsActive

ExtObjectContainer.isActive method provides you with means to define if the object is active.

UtilityExample.cs: CheckActive
01public static void CheckActive() 02 { 03 StoreSensorPanel(); 04 IObjectContainer db = Db4oFactory.OpenFile(YapFileName); 05 try 06 { 07 db.Ext().Configure().ActivationDepth(2); 08 System.Console.WriteLine("Object container activation depth = 2"); 09 IObjectSet result = db.Get(new SensorPanel(1)); 10 SensorPanel sensor = (SensorPanel)result[0]; 11 SensorPanel next = sensor.Next; 12 while (next != null) 13 { 14 System.Console.WriteLine("Object " + next +" is active: " + db.Ext().IsActive(next)); 15 next = next.Next; 16 } 17 } 18 finally 19 { 20 db.Close(); 21 } 22 }

UtilityExample.vb: CheckActive
01Public Shared Sub CheckActive() 02 StoreSensorPanel() 03 Dim db As IObjectContainer = Db4oFactory.OpenFile(YapFileName) 04 Try 05 db.Ext().Configure().ActivationDepth(2) 06 System.Console.WriteLine("Object container activation depth = 2") 07 Dim result As IObjectSet = db.Get(New SensorPanel(1)) 08 Dim sensor As SensorPanel = CType(result(0), SensorPanel) 09 Dim NextSensor As SensorPanel = sensor.NextSensor 10 While Not NextSensor Is Nothing 11 System.Console.WriteLine("Object " + NextSensor.ToString() + " is active: " + db.Ext().IsActive(NextSensor).ToString()) 12 NextSensor = NextSensor.NextSensor 13 End While 14 Finally 15 db.Close() 16 End Try 17 End Sub

This method can be useful in applications with deep object hierarchy if you prefer to use manual activation.