]> Cypherpunks repositories - gostls13.git/commit
database/sql: Add DB.SetConnMaxLifetime
authorINADA Naoki <songofacandy@gmail.com>
Tue, 3 Mar 2015 12:27:07 +0000 (21:27 +0900)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 2 Dec 2015 17:38:31 +0000 (17:38 +0000)
commit0c516c16328575ab78a4cce49874955dd590efa2
treeac5a5e86649358ae7a960fbb523b297c5e8f4490
parent2cb265d16c611aae56fd3f3ce87279a1f52f925a
database/sql: Add DB.SetConnMaxLifetime

Long lived connections may make some DB operation difficult.
(e.g. retiring load balanced DB server.)
So SetConnMaxLifetime closes long lived connections.

It can be used to limit maximum idle time, too.
Closing idle connections reduces active connections while application is idle
and avoids connections are closed by server side (cause errBadConn while querying).

fixes #9851

Change-Id: I2e8e824219c1bee7f4b885d38ed96d11b7202b56
Reviewed-on: https://go-review.googlesource.com/6580
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/database/sql/sql.go
src/database/sql/sql_test.go