Calling SP hangs when closing connection
Posted: Thu 03 Nov 2011 00:43
When calling a MySQL stored procedure that returns a recordset and having pooling=false, connection.close() hangs until command timeout reached. My DevArt.Data.MySQL version is 5.40.37.0, but I tested with the latest version and the same thing happens. I have tried with two different MySQL servers (one running 5.5.9 and one running 5.5.11) - same result. I have tried with and without command parameters, again same result.
I just tested with MySQL's Connector/Net and it works fine.
The SP:
If I do not execute SPs, but just do SELECT statements, everything works fine.
Please advise.
Thanks,
Lars
Ps. The reason I turned off pooling was to debug a similar problem where ExecuteReader intermittently hangs until command timeout reached (again, only when calling an SP returning a recordset).
I just tested with MySQL's Connector/Net and it works fine.
Code: Select all
using (var conn = new MySqlConnection("server=192.168.1.9; port=3306; user id=joe; password='...'; database=Test; pooling=false"))
{
conn.Open();
using (var cmd = new MySqlCommand("call test()", conn))
{
cmd.CommandType = System.Data.CommandType.Text;
cmd.CommandTimeout = 300;
MySqlDataReader dataReader = cmd.ExecuteReader();
while (dataReader.Read())
{
Console.WriteLine(String.Format("{0}", dataReader.GetValue(0)));
}
dataReader.Close();
dataReader.Dispose();
}
conn.Close(); // <-- Hangs until command timeout reached.
}
Code: Select all
select * from Test.Item limit 2;
Please advise.
Thanks,
Lars
Ps. The reason I turned off pooling was to debug a similar problem where ExecuteReader intermittently hangs until command timeout reached (again, only when calling an SP returning a recordset).