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);
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();
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);