Ejemplo n.º 1
0
        private void HandleTransaction(CommittedTransactionRepresentation tx)
        {
            lock (this)
            {
                if (_state == PANIC)
                {
                    return;
                }

                try
                {
                    _applier.queue(tx);
                }
                catch (Exception e)
                {
                    Panic(e);
                }
            }
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldApplyBatch() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldApplyBatch()
        {
            // given
            _txApplier.queue(CreateTxWithId(_startTxId + 1));
            _txApplier.queue(CreateTxWithId(_startTxId + 2));
            _txApplier.queue(CreateTxWithId(_startTxId + 3));

            // when
            _txApplier.applyBatch();

            // then
            assertEquals(_startTxId + 3, _txApplier.lastQueuedTxId());
            AssertTransactionsCommitted(_startTxId + 1, 3);
        }