You are here: Implementation Strategies > IDs And UUIDs > Internal IDs

Internal IDs

The internal db4o ID is a physical pointer into the database with only one indirection in the file to the actual object so it is the fastest external access to an object db4o provides. The internal ID of an object is available with

.NET:IObjectContainer.Ext().GetID(object)

To get an object for an internal ID use

.NET:IObjectContainer.Ext().GetByID(id)

Note that #getByID() does not activate objects. If you want to work with objects that you get with #getByID(), your code would have to make sure the object is activated by calling

.NET IObjectContainer.Activate(object, depth)

db4o assigns internal IDs to any stored first class object. These internal IDs are guaranteed to be unique within one ObjectContainer/ObjectServer and they will stay the same for every object when an ObjectContainer/ObjectServer is closed and reopened. Internal IDs will change when an object is moved from one ObjectContainer to another, as it happens during Defragment.