public void Rollback(InMemoryTransactionScope transactionScope) { Remove(transactionScope); _isRolledBack = true; RollbackTransaction(); }
public InMemoryTransactionScope BeginTransaction() { var inMemoryTransactionScope = new InMemoryTransactionScope(this); if (!HasActiveTransaction) { TakeTransactionSnapshot(); } _activeTransactions.Add(inMemoryTransactionScope); return(inMemoryTransactionScope); }
private void Remove(InMemoryTransactionScope transactionScope) { _activeTransactions.Remove(transactionScope); if (_activeTransactions.IsEmpty()) { if (_isRolledBack) { RollbackTransaction(); } _isRolledBack = false; } }
public void Commit(InMemoryTransactionScope transactionScope) { Remove(transactionScope); CommitTransaction(); }