[Mono-devel-list] MySQL timeout

Fabien Penso penso at linuxfr.org
Mon Feb 21 12:03:49 EST 2005


Mon, 21 Feb 2005 13:41:09 -0300, tu as dit : 

 > Well it sure looks like both mono and the mysql connector are doing
 > the right thing.

 > You is the one that is responsible for dealing with such conditions,
 > if needed, as your try/catches show that you understand how.

Well I would expect the connector to reconnect for me if there is a
timeout, mostly if it comes from a lower layer (the socket).

 > The problem is that you should be using the common ADO.NET idiom:

 > Open Connection
 > Execute Query
 > Read Data (if needed)
 > Close Connection

 > That way scales a lot better, even for Desktop Clients, as most
 > ADO.NET providers (connectors) implement connection pooling.

 > We should just determine if the connection pool manager of the mysql
 > connector, aside from killing unused connections after a timeout that
 > can alleviate your problem, has some checkConnectionLiveness feature
 > to avoid throwing that same exception in your face, when reusing a
 > connection...

I would have tought that is exactly the way not to do so when you use
that in a daemon with many queries, but I guess I'm wrong again. If the
mysql connector use a pool manager I guess it's fine, I'll try later
today to see how it works if I connect for each query.

Thanks for answering.



More information about the Mono-devel-list mailing list