Page 1 of 1

Automatically close pool connections upon app exit

Posted: Fri 06 Jan 2012 23:34
by LarsOberg
Hello,

When using connection pooling, the connections in the pool are not properly closed when exiting the application, which results in an "Aborted connection" error in the MySQL error log. The error log gets so full of these messages that it drowns out most other messages, so important stuff can easily get missed.

Calling ClearAllPools() manually works, but it would be much better if the DevArt component would do this automatically instead of manually have to put this into every app (especially with a large number of apps in production).

More info:
With Wireshark, you can see that an abrupt RST package is sent to the server upon application exit, causing the "Aborted connection" message. Calling ClearAllPools, causes a "Request quit" package to be sent first, making the server close the connection gracefully.

To reproduce, just run this and then exit the application:

Code: Select all

using (var conn = new MySqlConnection("server=192.168.1.2;
port=3306; user id=testuser; password='...'; database=Test; pooling=true"))
{
    conn.Open();
    conn.Close();
}

Posted: Tue 10 Jan 2012 16:58
by LarsOberg
Bump. Anyone??

Posted: Wed 11 Jan 2012 12:41
by Pinturiccio
We will investigate the issue and notify you as soon as possible.

Posted: Wed 11 Jan 2012 16:26
by LarsOberg
Great.

Also, I Oracle's MySQL Connector/Net has the same issue, so I filed a bug report with them as well:

http://bugs.mysql.com/bug.php?id=63942

They have verified the bug.

Lars

Posted: Thu 12 Jan 2012 09:05
by Pinturiccio
We correctly close our connection. Could you please specify the following:
1. What type of application do you use? (Console Application, Windows Form Application etc.)
2. How do you close your application (Terminate it or it's finished by itself)
3. Versions of dotConnect for MySQL and MySQL Server.

A small test project will be appreciated.

Posted: Thu 12 Jan 2012 16:18
by LarsOberg
This is with v 5.x of the driver. I just installed the latest driver and did another test and it is working fine!

Sorry for the false alarm.

Lars