database/sql: clarify docs for Tx.Stmt().Close() #16346
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Tx.Stmt()
example (go/src/database/sql/sql.go
Line 1332 in 733aefd
Looking at that code I assume there is no need to explicitly close the
Stmt
returned fromtx.Stmt(updateMoney)
because example does not even store references to it.On the other hand, tests (
go/src/database/sql/sql_test.go
Line 577 in 733aefd
go/src/database/sql/sql_test.go
Line 665 in 733aefd
Stmt
.So I wonder - is there an actual need to
.Close()
the prepared statements returned fromtx.Stmt()
or rollback/commit will close them automatically?/cc @bradfitz
The text was updated successfully, but these errors were encountered: