Error close conection

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
manolotux
Posts: 2
Joined: Thu 13 Oct 2011 19:48

Error close conection

Post by manolotux » Thu 13 Oct 2011 19:57

I have an application that I had not noticed but the connection does not close

I did a simple example was:

Obj = new MySqlConnection MySqlConnection ();
obj.Host = "machine";
obj.UserId = "root";
obj.Password = "123";
obj.Open ();

obj.Close ();

when I check with "SHOW PROCESSLIST" the connection is still alive, and only close until my application is closed

dotConnect's version is:
Devart.Data.dll = 5.0.93.0
Devart.Data.MySql.dll = 5.80.140.0

any solution that can help me?

regards

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 14 Oct 2011 08:18

Try using the "Pooling=false;" connection string parameter. For more information, please refer to http://www.devart.com/dotconnect/mysql/ ... q.html#q54.

manolotux
Posts: 2
Joined: Thu 13 Oct 2011 19:48

Post by manolotux » Fri 14 Oct 2011 23:04

not working

the connection is still alive

and when I create another connection with the same username and password I created a new one, there is something wrong if it's not but if the version is giving me some problems

I hope you can help me

regards

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 20 Oct 2011 13:38

Try using this code:

Code: Select all

    MySqlConnection obj = new MySqlConnection();
    obj.Host = "machine";
    obj.Port = 3306;
    obj.UserId = "root";
    obj.Password = "123";
    obj.ConnectionString += "Pooling=false;";
    obj.Open ();
    Console.WriteLine("execute SHOW PROCESSLIST at the database side to make sure that connection is alive");
    Console.ReadKey();

    obj.Close ();
    Console.WriteLine("execute SHOW PROCESSLIST at the database side to make sure that connection is killed");
    Console.ReadKey();
If this doesn't help, please specify the exact version (x.xx.xx) of your MySQL server.

Post Reply