Rollback() public method

public Rollback ( ) : void
return void
Ejemplo n.º 1
0
        public void Rollback()
        {
            if (_connection == null)
            {
                return;
            }
            if (_mode == CommandRunnerMode.External)
            {
                return;
            }

            try
            {
                _retryPolicy.Execute(() => _connection.Rollback());
            }
            catch (RollbackException e)
            {
                if (e.InnerException != null)
                {
                    Logger.LogFailure(new NpgsqlCommand(), e.InnerException);
                }
            }
            catch (Exception e)
            {
                Logger.LogFailure(new NpgsqlCommand(), e);
            }
            finally
            {
                _connection.Dispose();
                _connection = null;
            }
        }
Ejemplo n.º 2
0
        public void Rollback()
        {
            if (_connection == null)
            {
                return;
            }

            try
            {
                _connection.Rollback();
            }
            catch (RollbackException e)
            {
                if (e.InnerException != null)
                {
                    Logger.LogFailure(new NpgsqlCommand(), e.InnerException);
                }
            }
            catch (Exception e)
            {
                Logger.LogFailure(new NpgsqlCommand(), e);
            }
            finally
            {
                _connection.Dispose();
                _connection = null;
            }
        }