Hi there
I'm developing a web app using mysql 4.1 and corelab 2.7, .NET framework 1.1.
I use components (effectively) that maintain connections to the database. The connections are religiously closed.
Whenever the mysql server is restarted (by choice or accident), and the ASP process is not, the following exception is thrown:
Lost connection to MySQL server during query.
I've tried catching the exception, disposing the connection, reinstantiating, etc., but the only solution seems to be restarting the asp process (not ideal).
Any solutions?
Thanks in advance
Ben
Lost connection to MySQL server during query
Connection pool?
I've just been reading older posts, trying to get ideas.
Does the above error result from the connection pool?
Should I drain the pool on reception of this exception. or disable pooling to begin with? Once the pool has been drained do I need to dispose/reinstantiate etc.?
Again, thanks in advance.
Ben
Does the above error result from the connection pool?
Should I drain the pool on reception of this exception. or disable pooling to begin with? Once the pool has been drained do I need to dispose/reinstantiate etc.?
Again, thanks in advance.
Ben
Re: Connection pool?
Yes, this behaviour is related with the connection pool.
You shouldn't disable connection pooling as performance of your
ASP application can fall. When mysql server is restarted you should
wait for a while up to 5 minutes during which connection pool will remove
all connections itself. You can call MySqlConnection.ClearPool or
MySqlConnection.ClearAllPools for explicit release connections in the pool.
These methods don't release connections at once, they can release all
connections during some time in about 30 seconds.
You shouldn't disable connection pooling as performance of your
ASP application can fall. When mysql server is restarted you should
wait for a while up to 5 minutes during which connection pool will remove
all connections itself. You can call MySqlConnection.ClearPool or
MySqlConnection.ClearAllPools for explicit release connections in the pool.
These methods don't release connections at once, they can release all
connections during some time in about 30 seconds.