rug-compling/dact — Issue #48: Ability to cancel query
Author: jelmervdl
Created: 2011-11-03 12:07:29+00:00
State: open
Labels: bug, upstream

Currently, queries can be cancelled by pressing the escape key while the textfield is focussed. The problem is that the iterator blocks while searching for results, and there is no way to interrupt this block. As long as there are results found frequently, this is not a problem, but when running a query that doesn't yield any results, there is no way to interrupt it.

I already tried running the query in a separate thread, and kill the thread when I want to cancel a query. This works, sort of, but I can't run a second query because when the previous thread was terminated, it still owned the lock on some internal dbxml resources, which of course it didn't unlock.

Apparently dbxml has an API to cancel the query (I found this by searching thru the source code of their shell utility) [XmlQueryContext::interruptQuery()](http://download.oracle.com/docs/cd/E17276_01/html/api_reference/CXX/XmlQueryContext_interruptQuery.html). This would need to be implemented in AlpinoCorpus.