Beispiel #1
0
 public void OnRollbackAll()
 {
     if (_sub != null)
     {
         _sub.OnRollbackAll();
         _sub = null;
     }
     _status = SqlTransactionStatus.Rollbacked;
 }
Beispiel #2
0
 internal void OnCommitAbove()
 {
     if (_sub != null)
     {
         _sub.OnCommitAbove();
         _sub = null;
     }
     _status = SqlTransactionStatus.Committed;
 }
Beispiel #3
0
 public void Commit()
 {
     if (_status != SqlTransactionStatus.Opened)
     {
         throw new InvalidOperationException();
     }
     _sub?.OnCommitAbove();
     _status = SqlTransactionStatus.Committed;
     _sqlTransaction.Commit();
     _sqlTransaction.Dispose();
     _c.OnMainClosed();
 }
Beispiel #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();
 }
Beispiel #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);
     }
 }