Women in Technology

Hear us Roar

  Interruptible Database Queries
Subject:   What about the database?
Date:   2004-06-17 14:11:31
From:   Nick_Evans
Although the technique described will interrupt the query from the Java point of view, the query on the database may continue to completion and will only be interrupted when it tries to return the result set to Java. This is certainly true with Oracle, although there are some signs in very recent patch releases that the behaviour is starting to change, but only for read-only statements.

If an end-user uses the facility to cancel a query and then re-issues it immmediately (as they mught do when response times are long) the database could become full of spurious (cancelled) queries that are still consuming resource

Full Threads Newest First

Showing messages 1 through 1 of 1.

  • What about the database?
    2004-06-24 20:12:55  slavomir [View]

    Sorry Nick for a delay with my reply.
    You may have noticed that the cancel() method of the QueryExecutor class not only cancels the running query but also waits until the cancellation is completed. I'm not quite sure whether it originates in the driver on the client or on the server. Waiting until the server starts sending data would negate the whole idea of query cancellation. If database server vendors choose to implement query cancellation that does not stop a process still running on the server, then probably there is nothing we can do about it.