public PersistentIntegerArray(Db4objects.Db4o.Internal.Slots.SlotChangeFactory slotChangeFactory , ITransactionalIdSystem idSystem, int[] arr) : base(idSystem) { _slotChangeFactory = slotChangeFactory; _ints = new int[arr.Length]; System.Array.Copy(arr, 0, _ints, 0, arr.Length); }
/// <exception cref="System.Exception"></exception> public static void AssertAllSlotsFreed(LocalTransaction trans, BTree bTree, ICodeBlock block) { LocalObjectContainer container = (LocalObjectContainer)trans.Container(); ITransactionalIdSystem idSystem = trans.IdSystem(); IEnumerator allSlotIDs = bTree.AllNodeIds(trans.SystemTransaction()); Collection4 allSlots = new Collection4(); while (allSlotIDs.MoveNext()) { int slotID = ((int)allSlotIDs.Current); Slot slot = idSystem.CurrentSlot(slotID); allSlots.Add(slot); } Slot bTreeSlot = idSystem.CurrentSlot(bTree.GetID()); allSlots.Add(bTreeSlot); Collection4 freedSlots = new Collection4(); IFreespaceManager freespaceManager = container.FreespaceManager(); container.InstallDebugFreespaceManager(new FreespaceManagerForDebug(new _ISlotListener_99 (freedSlots))); block.Run(); container.InstallDebugFreespaceManager(freespaceManager); Assert.IsTrue(freedSlots.ContainsAll(allSlots.GetEnumerator())); }
public BTreeFreespaceManager(LocalObjectContainer file, IProcedure4 slotFreedCallback , int discardLimit) : base(slotFreedCallback, discardLimit) { _file = file; _delegate = new InMemoryFreespaceManager(slotFreedCallback, discardLimit); _idSystem = file.SystemData().FreespaceIdSystem(); }
public _IClosure4_58(IObjectContainer client, Lock4 Lock, ITransactionalIdSystem idSystem, int prefetchedID) { this.client = client; this.Lock = Lock; this.idSystem = idSystem; this.prefetchedID = prefetchedID; }
public BTreeConfiguration(ITransactionalIdSystem idSystem, SlotChangeFactory slotChangeFactory , int cacheSize, bool canEnlistWithTransaction) { _idSystem = idSystem; _slotChangeFactory = slotChangeFactory; _canEnlistWithTransaction = canEnlistWithTransaction; _cacheSize = cacheSize; }
public LocalTransaction(ObjectContainerBase container, Transaction parentTransaction , ITransactionalIdSystem idSystem, IReferenceSystem referenceSystem) : base(container , parentTransaction, referenceSystem) { _file = (LocalObjectContainer)container; _committedCallbackDispatcher = new _ICommittedCallbackDispatcher_39(this); _idSystem = idSystem; }
public LocalTransaction(ObjectContainerBase container, Transaction parentTransaction , ITransactionalIdSystem idSystem, IReferenceSystem referenceSystem) : base(container , parentTransaction, referenceSystem) { _file = (LocalObjectContainer) container; _committedCallbackDispatcher = new _ICommittedCallbackDispatcher_39(this); _idSystem = idSystem; }
private void FreeAllNodeIds(LocalTransaction systemTrans, IEnumerator allNodeIDs) { ITransactionalIdSystem idSystem = IdSystem(systemTrans); while (allNodeIDs.MoveNext()) { int id = ((int)allNodeIDs.Current); idSystem.NotifySlotDeleted(id, SlotChangeFactory()); } }
public override Transaction NewTransaction(Transaction parentTransaction, IReferenceSystem referenceSystem, bool isSystemTransaction) { ITransactionalIdSystem systemIdSystem = null; if (!isSystemTransaction) { systemIdSystem = SystemTransaction().IdSystem(); } IClosure4 idSystem = new _IClosure4_58(this); ITransactionalIdSystem transactionalIdSystem = NewTransactionalIdSystem(systemIdSystem , idSystem); return(new LocalTransaction(this, parentTransaction, transactionalIdSystem, referenceSystem )); }
public Msg ReplyFromServer() { int prefetchIDCount = ReadInt(); MsgD reply = Msg.IdList.GetWriterForLength(Transaction(), Const4.IntLength * prefetchIDCount ); lock (ContainerLock()) { ITransactionalIdSystem idSystem = Transaction().IdSystem(); for (int i = 0; i < prefetchIDCount; i++) { reply.WriteInt(idSystem.PrefetchID()); } } return(reply); }
public BTreeIdSystem(LocalObjectContainer container, IStackableIdSystem parentIdSystem , int maxValidId) { _container = container; _parentIdSystem = parentIdSystem; _transactionalIdSystem = container.NewTransactionalIdSystem(null, new _IClosure4_40 (parentIdSystem)); int persistentArrayId = parentIdSystem.ChildId(); if (persistentArrayId == 0) { InitializeNew(); } else { InitializeExisting(persistentArrayId); } _idGenerator = new SequentialIdGenerator(new _IFunction4_52(this), IdGeneratorValue (), _container.Handlers.LowestValidId(), maxValidId); }
public virtual void Close(bool rollbackOnClose) { if (Container() != null) { CheckSynchronization(); Container().ReleaseSemaphores(this); DiscardReferenceSystem(); } if (rollbackOnClose) { Rollback(); } ITransactionalIdSystem idSystem = IdSystem(); if (idSystem != null) { idSystem.Close(); } }
/// <exception cref="System.Exception"></exception> public virtual void Test() { ObjectServerImpl server = (ObjectServerImpl)Db4oClientServer.OpenServer(TempFile( ), Db4oClientServer.ArbitraryPort); Lock4 Lock = new Lock4(); server.ClientDisconnected += new System.EventHandler <Db4objects.Db4o.Events.StringEventArgs> (new _IEventListener4_39(Lock).OnEvent); server.GrantAccess(User, Password); IObjectContainer client = OpenClient(server.Port()); ServerMessageDispatcherImpl msgDispatcher = FirstMessageDispatcherFor(server); Transaction transaction = msgDispatcher.Transaction(); ITransactionalIdSystem idSystem = transaction.IdSystem(); int prefetchedID = idSystem.PrefetchID(); Assert.IsGreater(0, prefetchedID); Lock.Run(new _IClosure4_58(client, Lock, idSystem, prefetchedID)); // This wont work with the PointerBasedIdSystem server.Close(); }
public LocalPersistentBase(ITransactionalIdSystem idSystem) { _idSystem = idSystem; }
public PersistentIntegerArray(SlotChangeFactory slotChangeFactory , ITransactionalIdSystem idSystem, int id) : base(idSystem) { _slotChangeFactory = slotChangeFactory; SetID(id); }
public BTreeConfiguration(ITransactionalIdSystem idSystem, int cacheSize, bool canEnlistWithTransaction ) : this(idSystem, SlotChangeFactory.SystemObjects, cacheSize, canEnlistWithTransaction ) { }
public PersistentIntegerArray(Db4objects.Db4o.Internal.Slots.SlotChangeFactory slotChangeFactory , ITransactionalIdSystem idSystem, int id) : base(idSystem) { _slotChangeFactory = slotChangeFactory; SetID(id); }
public virtual void FreespaceIdSystem(ITransactionalIdSystem transactionalIdSystem ) { _freespaceIdSystem = transactionalIdSystem; }
public virtual ITransactionalIdSystem NewTransactionalIdSystem(ITransactionalIdSystem systemIdSystem, IClosure4 idSystem) { return(new TransactionalIdSystemImpl(new _IClosure4_69(this), idSystem, (TransactionalIdSystemImpl )systemIdSystem)); }
internal TransactionObjectCarrier(ObjectContainerBase container, Transaction parentTransaction , ITransactionalIdSystem idSystem, IReferenceSystem referenceSystem) : base(container , parentTransaction, idSystem, referenceSystem) { _idSystem = idSystem; }
public virtual ITransactionalIdSystem NewTransactionalIdSystem(ITransactionalIdSystem systemIdSystem, IClosure4 idSystem) { return new TransactionalIdSystemImpl(new _IClosure4_69(this), idSystem, (TransactionalIdSystemImpl )systemIdSystem); }
public virtual void TransactionalIdSystem(ITransactionalIdSystem transactionalIdSystem ) { _transactionalIdSystem = transactionalIdSystem; }
public _ICodeBlock_63(ITransactionalIdSystem idSystem, int prefetchedID) { this.idSystem = idSystem; this.prefetchedID = prefetchedID; }