SQL: driver is opening a new connection for every transaction
The Go SQL driver is supposed to recycle a connection after a transaction with the server. I'm seeing it open a new connection for every call to db.Begin() var db *sql.DB tx, err := db.Begin()
Is it unbounded? The Go SQL driver doesn't start recycling until the pool is full, I believe. See: http://godoc.org/database/sql#DB.SetMaxIdleConns http://godoc.org/database/sql#DB.SetMaxOpenConns
Looks like it just hangs after reaching the limit. It really should use a free connection rather than opening a new one.
Looks like it just hangs after reaching the limit.
Interesting. Can you write a test that repros this?
It really should use a free connection rather than opening a new one.
Heh, this is out of our control.
yeah will write a test as I work on a fix
On Thu, Aug 6, 2015 at 3:19 PM Tamir Duberstein [email protected] wrote:
Looks like it just hangs after reaching the limit.
Interesting. Can you write a test that repros this?
It really should use a free connection rather than opening a new one.
Heh, this is out of our control.
— Reply to this email directly or view it on GitHub https://github.com/cockroachdb/cockroach/issues/2007#issuecomment-128479139 .
I was not calling Commit() on the transaction because our current version of Commit() is unimplemented and returns an error. Once I call it, it works. This is not a bug.