You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example for how to do transactions with pgx added in #3557 will always run Rollback. The rollback will return an error which appears silent, but isn't if pgx is wrapped in opentelemetry tracing.
Instead of always doing a Rollback I believe you can make a context.WithCancel context and then defer cancel() will rollback the transaction if it's not already committed.
Activity
crhntr commentedon Feb 4, 2025
This documentation seems relevant: https://pkg.go.dev/github.com/jackc/pgx/v5#Conn.BeginTx
abh commentedon Feb 5, 2025
doh, thanks @crhntr!