Toad World® Forums

Cancel not always working

When executing the following code with SQL*Plus, I can cancel it immediately with Ctrl+C:

EXEC dbms_lock.sleep(10);

With TOAD, pressing Cancel sometimes returns before the 10 seconds are over, but usually it takes 10 seconds.

Is there a way to improve this?

Hey Peter,

From a quick test, this appears to be related to the “Execute queries in threads” setting in Options->Oracle->Transactions. If checked, I always have to wait for the current command to finish. If unchecked, a cancel returns control to Toad immediately. SQL*Plus does not have this option, so it acts like having the Toad option unchecked. The downside is that one loses one of my favorite features of Toad – its threadedness!

While I obviously don’t know anything about Toad’s inner workings, some vague recollection of mine says this might be more of an Oracle Networking limitation, which no Oracle Client can override. I’m not sure, but thought I should put that out there as a possibility…

In any case, check out that option to see if it’s a viable workaround for you.

HTH! GL!

Rich

For me, this cancels right away even with the threaded query option checked.

We should be sending the cancel command to Oracle as soon as you click the cancel button, but we have to wait for Oracle to say “OK, I cancelled it” with an “ORA-01013: user requested cancel of current operation” before the query is actually cancelled. I’m not sure why in some cases it comes back right away and in other cases it doesn’t.