Exemplo n.º 1
0
        public void RollbackTransaction()
        {
            var operationId = Guid.Empty;

            try
            {
                operationId = _diagnosticListener.WriteDbSessionRollbackBefore(this);
                #region Impl
                if (_logger.IsEnabled(LogLevel.Debug))
                {
                    _logger.LogDebug("RollbackTransaction .");
                }
                if (Transaction == null)
                {
                    if (_logger.IsEnabled(LogLevel.Warning))
                    {
                        _logger.LogWarning("Before RollbackTransaction,Please BeginTransaction first!");
                    }
                    _diagnosticListener.WriteDbSessionRollbackAfter(operationId, this);
                    return;
                }
                Transaction.Rollback();
                ReleaseTransaction();
                Rollbacked?.Invoke(this, DbSessionEventArgs.None);
                #endregion
                _diagnosticListener.WriteDbSessionRollbackAfter(operationId, this);
            }
            catch (Exception ex)
            {
                _diagnosticListener.WriteDbSessionRollbackError(operationId, this, ex);
                throw;
            }
        }
Exemplo n.º 2
0
 public void Rollback(DbConn aDbConn)
 {
     //トランザクションを取り消す
     try {
         aDbConn.RollbackImp();
     } catch (Exception ex) {
         //ROLLBACKに失敗した場合は再度ROLLBACKを行い、
         //それが成功した場合は正常な処理に復帰する
         try {
             aDbConn.RollbackImp();
         } catch (Exception ex2) {
             //Error1状態に遷移して例外を再送出する
             aDbConn.GoToError1AndThrow(ex2, true);
         }
     }
     //次の状態に遷移する
     aDbConn.GoToNextState(Rollbacked.GetInstance());
 }
Exemplo n.º 3
0
 public void Rollback(DbConn aDbConn)
 {
     //次の状態に遷移する
     aDbConn.GoToNextState(Rollbacked.GetInstance());
 }
Exemplo n.º 4
0
 public void Rollback()
 {
     raw.Rollback();
     Rollbacked?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 5
0
 public void Rollback()
 {
     Transaction.Rollback();
     Rollbacked?.Invoke(this, EventArgs.Empty);
 }