Am 10/24/2012 10:19 PM, schrieb Nick Sabalausky:

On Wed, 24 Oct 2012 16:13:41 -0400
Nick Sabalausky SeeWebsiteToContactMe@semitwist.com wrote:

On Wed, 24 Oct 2012 21:13:12 +0200
Sönke Ludwig sludwig@rejectedsoftware.com wrote:

Yep! They'll stay open until something forcably closes them. The
downside, I think, is that the MySQL driver does not detect when a
connection is broken and does not restart it, this is something that
still needs to be implemented to make it more robust.

Is there a recommended way to check if the connection is still open?

Like, just try to use it and then catch/inspect any resulting MySQL
exception?

I
don't see any property like isopen(), just an internal _open flag
which I'm guessing is probably not guaranteed to be updated if the
connection breaks in ways other than calling close().

For the MongoDB driver I defined the connection to be always open. It
will reconnect automatically, if it detects a connection loss right
before a command is issued and throw if either the connection attempt
fails, or if the connection fails while a command message is sent or
received.

Another possibility would of course be to put that logic in the
ConnectionPool, if that is used for every connection anyway, this would
require less overall code. But first I'll dig a bit in the MySQL driver
code and see if there is a convenient place for this.