Hi,
I've been having trouble with my asp-net app for a few days but I've now finally nailed it (well, I'm pretty sure that this is it) to the fact that my hosting provider has changed the MySQL system value 'wait_timeout' to a just 60 seconds (the default is 8 hours). This means that any connection on which there's no activity for 60 seconds gets killed. The trouble is that this means that it's much more likely that connections in the connection pool can be disconnected, but this disconnection doesn't remove them from the pool - My asp.net app will happily pick up the connection and try to use it despite the fact that the connection is no longer actually connected. Now here's the killer - When I'm using OleDb (with the standard MySQL provided OleDb driver) then the OleDbConnection realises that the connection has gone and will auto re-connect, BUT the CoreLab MySqlConnection simply throws an exception 'Lost Connection' when a MySqlCommand tries to execute some sql via the connection. It took hours to work this out - Is it making any sense??!!
I can fix this by simply switching off connection pooling, however is there a more elegant way that the MySqlConnection can handle this situation? Maybe a new property of the MySqlConnection could be created called something like 'AutoReconnect'??!! Any help would be greatly appreciated!!
Many Thanks
MySqlConnection Lost Connection Handling (new feature?)
-
- Posts: 5
- Joined: Sat 22 Jan 2005 15:56