MySqlCommand ExecuteNonQuery locks

MySqlCommand ExecuteNonQuery locks

Postby tinpotnick » Wed 16 Jan 2008 11:08

Hello all,

I have just moved from the Mysql .net provider as I need SSL and it appears to work on this version. SoI ported my code to use corelabs MyDirect provider and on the whole it was easy and it works (and so does SSL).

The problem I have though is ExecuteNonQuery when performing an update performs the update, but never returns - it enters a lock/sleep state, which locks the application.

String Sql = "UPDATE Activity SET ";
Sql += "loads of other SQL";

using (MySqlCommand command = new MySqlCommand(Sql, this.Connection))
command.Parameters.AddWithValue(":Title", ActivityDetails.Title);
command.Parameters.AddWithValue(":Type", ActivityDetails.Type);
command.Parameters.AddWithValue(":CaseID", ActivityDetails.CaseID);
command.Parameters.AddWithValue(":UserID", ActivityDetails.AssignTo);
command.Parameters.AddWithValue(":ScheduledDate", ActivityDetails.Scheduled);
command.Parameters.AddWithValue(":CompletedDate", ActivityDetails.CompletedDate);
command.Parameters.AddWithValue(":TimeTaken", ActivityDetails.TimeTaken);
command.Parameters.AddWithValue(":Details", ActivityDetails.Details);
command.Parameters.AddWithValue(":Progress", ActivityDetails.Progress);

command.Parameters.AddWithValue(":ModifiedBy", this.UserDetails.UserID);

command.Parameters.AddWithValue(":ActivityID", ActivityDetails.ActivityID);

//this is where it locks...

The connection is a member variable which gets re-used.

It is a trial version


Posts: 2
Joined: Wed 16 Jan 2008 10:50
Location: Berkhamsted, UK


Postby tinpotnick » Wed 16 Jan 2008 13:55

I found the solution.

Not sure why it doesn't do it on all calls, but it is simply the properties in the project debug->enable unmanaged code debug.

Posts: 2
Joined: Wed 16 Jan 2008 10:50
Location: Berkhamsted, UK

Return to dotConnect for MySQL