public async Task RollbackAsync(CancellationToken token) { if (_connection == null) { return; } if (_mode == CommandRunnerMode.External) { return; } try { await _retryPolicy.ExecuteAsync(async() => await _connection.RollbackAsync(token).ConfigureAwait(false), token); } 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; } }
public async Task RollbackAsync(CancellationToken token) { if (_connection == null) { return; } try { await _connection.RollbackAsync(token).ConfigureAwait(false); } 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; } }