// retain the object, as ObjectStore may have weak references to registered
// objects and we can't allow it to deallocate dirty objects.
this.object = object;
EntityResolver entityResolver = object.getObjectContext().getEntityResolver();
this.entityName = object.getObjectId().getEntityName();
this.classDescriptor = entityResolver.getClassDescriptor(entityName);
int state = object.getPersistenceState();
// take snapshot of simple properties and arcs used for optimistic locking..
if (state == PersistenceState.COMMITTED
|| state == PersistenceState.DELETED
|| state == PersistenceState.MODIFIED) {
ObjEntity entity = entityResolver.getObjEntity(entityName);
final boolean lock = entity.getLockType() == ObjEntity.LOCK_TYPE_OPTIMISTIC;
this.snapshot = new HashMap<String, Object>();
this.arcSnapshot = new HashMap<String, Object>();