Esempio n. 1
0
        public void Rollback(InMemoryTransactionScope transactionScope)
        {
            Remove(transactionScope);

            _isRolledBack = true;

            RollbackTransaction();
        }
Esempio n. 2
0
        public InMemoryTransactionScope BeginTransaction()
        {
            var inMemoryTransactionScope = new InMemoryTransactionScope(this);

            if (!HasActiveTransaction)
            {
                TakeTransactionSnapshot();
            }

            _activeTransactions.Add(inMemoryTransactionScope);

            return(inMemoryTransactionScope);
        }
Esempio n. 3
0
        private void Remove(InMemoryTransactionScope transactionScope)
        {
            _activeTransactions.Remove(transactionScope);

            if (_activeTransactions.IsEmpty())
            {
                if (_isRolledBack)
                {
                    RollbackTransaction();
                }

                _isRolledBack = false;
            }
        }
Esempio n. 4
0
 public void Commit(InMemoryTransactionScope transactionScope)
 {
     Remove(transactionScope);
     CommitTransaction();
 }