Options - Cancel Queries
This option specifies whether long-running queries are able to be cancelled.
To understand this, you should realise that queries are run in two phases:
- running the query on the server
- fetching the results
If you are running a delete or update, only the first of these two phases is applicable.
By default, AQT is locked during the first of these two phases. During the second phase, AQT is active and the query can be cancelled by clicking on the Abort button.
There are two ways to cancel the query during the first phase:
- ODBC Driver. This option is available if your ODBC Driver supports asynchronous processing. In this case, AQT is not locked while the query is running on the server. The Abort button will be active, and you will be able to cancel the query by clicking on this. The disadvantage of this method is that many ODBC Drivers do not support asynchronous processing; the Oracle, Sybase, Informix and DB2 v8 ODBC Drivers are just some that do not support it.
- AQT Cancel task. To provide another mechanism for cancelling queries, we have developed the AQT Cancel Task. This runs separately on your machine (from a technical viewpoint it runs as a separate thread in the same process). This task will remain active while AQT is locked; clicking on the Abort button on the AQT Cancel window will cancel the query (AQT will then become active).
Delay period
If you are using the Cancel task option, you need to specify how many seconds are to pass before the Cancel task window appears. The default is 5 seconds.
Start Minimised
This specifies whether the Cancel task is to start minimised. It will appear in the System tray.
Using the Cancel window
- clicking on the Abort button doesn't immediately cancel the query; it sends a cancel request to the database server. It may be several seconds before the query is actually cancelled.
- sometimes you may get an error message after clicking on the Abort button. If the error text doesn't display fully, you can click on the error text to see it in full.
- you can Minimise the window; it will then be placed in the System Tray. Clicking on the icon will open it again, alternatively you can right-click the icon and select Cancel Query or Restore Cancel window
Note for DB2/Connect Users
If you are connecting to a DB2 z/OS or DB2 for iSeries system via DB2/Connect, then you can only cancel a query if your DB2 Server supports interrupts. If it does not, you can specify that the DB2/Connect server is to handle interrupt processing. This is done by setting the INTERRUPT_ENABLED flag on the DCS entry for the connection.