mirror of https://github.com/jackc/pgx.git
Close database/sql connections created through ConnPool
database/sql driver created through stdlib.OpenFromConnPool closes connections when requested by database/sql rather than release to underlying connection pool.conn-pool-reset
parent
6b2cb6800e
commit
cd16be9308
|
@ -1,3 +1,9 @@
|
||||||
|
# Unreleased
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
* database/sql driver created through stdlib.OpenFromConnPool closes connections when requested by database/sql rather than release to underlying connection pool.
|
||||||
|
|
||||||
# 2.11.0 (June 5, 2017)
|
# 2.11.0 (June 5, 2017)
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|
|
@ -180,12 +180,12 @@ func (c *Conn) Prepare(query string) (driver.Stmt, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Conn) Close() error {
|
func (c *Conn) Close() error {
|
||||||
|
err := c.conn.Close()
|
||||||
if c.pool != nil {
|
if c.pool != nil {
|
||||||
c.pool.Release(c.conn)
|
c.pool.Release(c.conn)
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.conn.Close()
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Conn) Begin() (driver.Tx, error) {
|
func (c *Conn) Begin() (driver.Tx, error) {
|
||||||
|
|
Loading…
Reference in New Issue