private void WriteToFile(Transaction trans, ByteArrayBuffer writer, Slot slot) { if (DTrace.enabled) { DTrace.PersistentbaseWrite.Log(GetID()); } LocalObjectContainer container = (LocalObjectContainer)trans.Container(); WriteThis(trans, writer); container.WriteEncrypt(writer, slot.Address(), 0); if (IsActive()) { SetStateClean(); } }
public override void Write(LocalObjectContainer container) { Slot slot = container.AllocateSlot(MarshalledLength()); while (slot.Length() < MarshalledLength()) { // This can happen if DatabaseGrowthSize is configured. // Allocating a slot may produce an additional entry // in this FreespaceManager. container.Free(slot); slot = container.AllocateSlot(MarshalledLength()); } ByteArrayBuffer buffer = new ByteArrayBuffer(slot.Length()); TreeInt.Write(buffer, (TreeInt)_freeBySize); container.WriteEncrypt(buffer, slot.Address(), 0); container.SystemData().InMemoryFreespaceSlot(slot); }