public virtual void ReadIdentity(LocalTransaction trans) { LocalObjectContainer file = trans.LocalContainer(); Db4oDatabase identity = Debug4.staticIdentity ? Db4oDatabase.StaticIdentity : (Db4oDatabase )file.GetByID(trans, SystemData().IdentityId()); if (null != identity) { file.Activate(trans, identity, new FixedActivationDepth(2)); SystemData().Identity(identity); } }
public virtual void ReadIdentity(LocalTransaction trans) { var file = trans.LocalContainer(); var identity = Debug4.staticIdentity ? Db4oDatabase.StaticIdentity : (Db4oDatabase ) file.GetByID(trans, SystemData().IdentityId()); if (null != identity) { file.Activate(trans, identity, new FixedActivationDepth(2)); SystemData().Identity(identity); } }
private void WriteIdSlotPairsTo(IList slots, ByteArrayBuffer buffer) { buffer.WriteInt(slots.Count); for (IEnumerator idSlotPairIter = slots.GetEnumerator(); idSlotPairIter.MoveNext( );) { Pair idSlotPair = ((Pair)idSlotPairIter.Current); int id = (((int)idSlotPair.first)); Slot slot = ((Slot)idSlotPair.second); if (Slot.IsNull(slot)) { buffer.WriteInt(id); buffer.WriteInt(0); continue; } ByteArrayBuffer slotBuffer = _transaction.LocalContainer().ReadBufferBySlot(slot); buffer.WriteInt(id); buffer.WriteInt(slot.Length()); buffer.WriteBytes(slotBuffer._buffer); } }