This example demonstrates how you can use db4o-UUIDs to identify objects across objects containers. Take a look advantages and disadvantages of db4o-UUIDs: See "Comparison Of Different IDs"
First you need to enable db4o-UUIDs in order to use it.
configuration.File.GenerateUUIDs = ConfigScope.Globally;
configuration.File.GenerateUUIDs = ConfigScope.Globally
With UUIDs turned on, db4o will create an UUID for each stored object. So you can get the UUID of the object from the object-container.
Db4oUUID uuid = container.Ext().GetObjectInfo(obj).GetUUID();
Dim uuid As Db4oUUID = container.Ext().GetObjectInfo(obj).GetUUID()
Getting a object by its UUID is also easy. First you get the object from the container. Unlike queries this won't activate your object. So you have to do it explicitly.
object objectForId = container.Ext().GetByUUID(idForObject); // getting by uuid doesn't activate the object // so you need to do it manually container.Ext().Activate(objectForId);
Dim objForId As Object = container.Ext().GetByUUID(idForObject) ' getting by uuid doesn't activate the object ' so you need to do it manually container.Ext().Activate(objForId)