Page 1 of 1

Error close conection

Posted: Thu 13 Oct 2011 19:57
by manolotux
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

Posted: Fri 14 Oct 2011 08:18
by Shalex
Try using the "Pooling=false;" connection string parameter. For more information, please refer to http://www.devart.com/dotconnect/mysql/ ... q.html#q54.

Posted: Fri 14 Oct 2011 23:04
by manolotux
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

Posted: Thu 20 Oct 2011 13:38
by Shalex
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.