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); }
/// <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(); }