Automatically close pool connections upon app exit

Automatically close pool connections upon app exit

Postby LarsOberg » Fri 06 Jan 2012 23:34

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();
}
LarsOberg
 
Posts: 41
Joined: Tue 11 Oct 2005 18:45

Postby LarsOberg » Tue 10 Jan 2012 16:58

Bump. Anyone??
LarsOberg
 
Posts: 41
Joined: Tue 11 Oct 2005 18:45

Postby Pinturiccio » Wed 11 Jan 2012 12:41

We will investigate the issue and notify you as soon as possible.
Pinturiccio
Devart Team
 
Posts: 1849
Joined: Wed 02 Nov 2011 09:44

Postby LarsOberg » Wed 11 Jan 2012 16:26

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
LarsOberg
 
Posts: 41
Joined: Tue 11 Oct 2005 18:45

Postby Pinturiccio » Thu 12 Jan 2012 09:05

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.
Pinturiccio
Devart Team
 
Posts: 1849
Joined: Wed 02 Nov 2011 09:44

Postby LarsOberg » Thu 12 Jan 2012 16:18

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
LarsOberg
 
Posts: 41
Joined: Tue 11 Oct 2005 18:45


Return to dotConnect for MySQL