Rollback should mark tx as closed

pull/620/head
Jack Christensen 2019-09-19 22:03:29 -05:00
parent 9b9df4abdf
commit 585fac4561
1 changed files with 1 additions and 0 deletions

1
tx.go
View File

@ -159,6 +159,7 @@ func (tx *dbTx) Rollback(ctx context.Context) error {
}
_, err := tx.conn.Exec(ctx, "rollback")
tx.closed = true
if err != nil {
// A rollback failure leaves the connection in an undefined state
tx.conn.die(errors.Errorf("rollback failed: %w", err))