コード例 #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;
            }
        }
コード例 #2
0
 public void Rollback()
 {
     raw.Rollback();
     Rollbacked?.Invoke(this, EventArgs.Empty);
 }
コード例 #3
0
 public void Rollback()
 {
     Transaction.Rollback();
     Rollbacked?.Invoke(this, EventArgs.Empty);
 }