[Mono-dev] Program not able to exit after using MySql-Connector

Clas Rurik clas at spectratic.de
Sat May 10 18:39:21 EDT 2008


Hopefully this question was not asked before but during my efforts to connect
to a mysql database I encountered a problem. After a connection has been
established the program is not able to quit anymore. At the end of the
Main-Method it simply keeps running.

The following sample code is not able to exit (after a connection has been
established succesfully). If an error occures the program will exit.

(This small example is inspired from the mono page
http://www.mono-project.com/MySQL)
-------------------------------
IDbConnection dbcon = null;

string connectionString =
  "Server=localhost;" +
  "Database=dbname;" +
  "User ID=user;" +
  "Password=password;" +
  "Pooling=false";
dbcon = new MySqlConnection(connectionString);
dbcon.Open();

dbcon.Close();
dbcon = null;
-------------------------------

I executed this sample program with mdb (mono debug) and it showed me that
for the connection 3 threads got started from which only 1 stoped normally.

I am using mono 1.2.6 with MySql Connector 5.0.8.1 (Ubuntu repo).

Under windows the sample program (and similar ones) exit without problems,
even with the MySql Connector from the Ubuntu repos.

Am I doing something wrong or is this a serious problem?

Thanks for every single answer,

- Clas
-- 
View this message in context: http://www.nabble.com/Program-not-able-to-exit-after-using-MySql-Connector-tp17168277p17168277.html
Sent from the Mono - Dev mailing list archive at Nabble.com.



More information about the Mono-devel-list mailing list