Error "An existing connection was forcibly closed by the remote host" after 15 minutes of no activity
Posted by: Martin Legris
Date: October 08, 2006 09:18PM

Hi.

I just upgraded to the Connector/Net 5.0.1 because it seems the other version of the connector (1.0.x) wouldn't work properly with MySQL 5.x (anyhow, I can't understand what other error source it could be if that's not the reason!).

Basically everything runs fine under 5.0.1 Beta, BUT I do run into problems if my application doesn't run queries regularly. If I let it sit for say, 15+ minutes, and I click on a button which triggers a query I get the following error :

"An existing connection was forcibly closed by the remote host".

Now I do run _conn.Open() at the beginning of each call, and _conn.Close() at the end of each call (all of them are triggered by user interaction). So you would think it would open a new connection right at the beginning of the call.

To get around the problem I tried to call _conn.Dispose() and reinstantiate the connection object (with new MySqlConnection...) fresh for each call with no luck. If I understand properly this is a pooling issue, whereas my connection in the pool HAS been killed by the other side. But why doesn't it try to reconnect? Especially since I call _conn.Open() at the beginning of each call?

I didn't change a iota in my code since I switched from Connector/NET 1.x to 5.0.1 Beta, so I'm guessing it could be a bug. I did however change servers (from MySQL 3.23.x to 5.0.x AND on a new service provider) and maybe this one does kill connections that are inactive while the other didn't.

Should I simply disable pooling? Or run dummy queries at regular intervals? I need to patch this problem ASAP.

Thanks

Martin Legris
http://www.newcommerce.ca



Edited 4 time(s). Last edit at 10/09/2006 02:01PM by Martin Legris.

Options: ReplyQuote


Subject
Written By
Posted
Error "An existing connection was forcibly closed by the remote host" after 15 minutes of no activity
October 08, 2006 09:18PM
October 11, 2006 12:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.