-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
pgxpool.Tx.{Commit,Rollback} contain the following snippet (https://github.com/jackc/pgx/blob/v5.7.6/pgxpool/tx.go#L25):
if tx.c != nil {
tx.c.Release()
tx.c = nil
}However the documentation for pgxpool.Conn.Release says
"However, it is safe to call Release multiple times. Subsequent calls after the first will be ignored."
and the implementation exits quickly if the Release was called already (https://github.com/jackc/pgx/blob/v5.7.6/pgxpool/conn.go#L20):
if c.res == nil {
return
}
conn := c.Conn()
res := c.res
c.res = nilSo is the checking in Tx redundant?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels