cancel command

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
DaveRob

cancel command

Post by DaveRob » Fri 07 Jan 2005 21:52

I'd like to cancel a command while it is processing. Is it possible? I know there's a Cancel method with mysqlcommand but the help says : This command is not supported! So is there any another way?

Oleg
Devart Team
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Re: cancel command

Post by Oleg » Mon 10 Jan 2005 12:20

The only possibility to break an execution of command in MySQL is to break a connection so we are unable to implement method MySqlCommand.Cancel well.

DaveRob
Posts: 4
Joined: Fri 07 Jan 2005 21:55

Post by DaveRob » Mon 10 Jan 2005 17:29

MySQL does not return a process ID? Which we could use to kill the job.

Oleg
Devart Team
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Post by Oleg » Tue 11 Jan 2005 14:40

It is possible to break an execution of the command if to cut a connection or remove process at the server using KILL command.
But it isn't a good solution as after executing of this operation that relates to the command we have invalid connection. So MySqlCommand.Cancel method we cannot implement as this method will close a connection. You can have another commands associated with the same connection, but this behaviour can cause problems in your code.
We can implement method MySqlConnection.Kill that will close a connection and break an execution of the command on this connection.

DaveRob
Posts: 4
Joined: Fri 07 Jan 2005 21:55

Post by DaveRob » Tue 11 Jan 2005 15:34

The kill method could be interesting even if all other commands associated with this connection would be killed. If we know that we just have to take care and don't associate another commands to the connection.

Oleg
Devart Team
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Post by Oleg » Fri 14 Jan 2005 07:26

We are planning to add Kill method for MySqlConnection.
It will be in the next version of MySQLDirect .NET that will be available in about a month.

Post Reply