Exemplo n.º 1
0
 public void OnRollbackAll()
 {
     if (_sub != null)
     {
         _sub.OnRollbackAll();
         _sub = null;
     }
     _status = SqlTransactionStatus.Rollbacked;
 }
Exemplo n.º 2
0
 internal void OnCommitAbove()
 {
     if (_sub != null)
     {
         _sub.OnCommitAbove();
         _sub = null;
     }
     _status = SqlTransactionStatus.Committed;
 }
Exemplo n.º 3
0
 public void Commit()
 {
     if (_status != SqlTransactionStatus.Opened)
     {
         throw new InvalidOperationException();
     }
     _sub?.OnCommitAbove();
     _status = SqlTransactionStatus.Committed;
     _sqlTransaction.Commit();
     _sqlTransaction.Dispose();
     _c.OnMainClosed();
 }
Exemplo n.º 4
0
 public void RollbackAll()
 {
     if (_status != SqlTransactionStatus.Opened)
     {
         throw new InvalidOperationException();
     }
     if (_sub != null)
     {
         _sub.OnRollbackAll();
         _sub = null;
     }
     _status = SqlTransactionStatus.Rollbacked;
     _sqlTransaction.Rollback();
     _sqlTransaction.Dispose();
     _c.OnMainClosed();
 }
Exemplo n.º 5
0
 public void Commit()
 {
     if (_status != SqlTransactionStatus.Opened)
     {
         throw new InvalidOperationException();
     }
     if (!RestoreSuperIsolationLevel())
     {
         RollbackAll();
     }
     else
     {
         if (_sub != null)
         {
             _sub.OnCommitAbove();
             _sub = null;
         }
         _status = SqlTransactionStatus.Committed;
         RestoreSuperIsolationLevel();
         _super.OnSubClose(_super, 1);
     }
 }