Dear all,
Currently I am programming a database app using JOOQ where most of the queries are performed within SwingWorkers (i.e. in a thread different from the EDT).
What is the preferred way to cancel a (long running) query such as the following within a SwingWorker:
class Worker extends SwingWorker...
{
protected Void doInBackground()
{
//this takes a long time
Result<Record> data = create.fetch(Query);
//this is rather quick
for (Record r : data) {
publish(r);
}
}
checking for SwingWorker.isCancelled() in the for loop does not make sense as the most time is spend in the query itself. How can I programmatically abort the query execution?
Thanks and best regards
Christian