cancel command
cancel command
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?
Re: cancel command
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.
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.
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.