Cancelling long running query
Hello there,
I have had a look in the documentation and was wondering, is it possible to cancel a query once it has been submitted using ClientQuery/ClientSession?
Would calling close() on ClientQuery do that?
Shaun
You could use jobs:eval(query…), where you provide the query and you get back an Id for the job. You can then cancel the job using jobs:stop(id)
Quoted text · BaseX-Talk · 8 lines
From: BaseX-Talk <basex-talk-bounces at mailman.uni-konstanz.de> On Behalf Of Shaun Flynn Sent: Tuesday, June 26, 2018 4:41 AM To: BaseX <basex-talk at mailman.uni-konstanz.de> Subject: [basex-talk] Cancelling long running query Hello there, I have had a look in the documentation and was wondering, is it possible to cancel a query once it has been submitted using ClientQuery/ClientSession? Would calling close() on ClientQuery do that? Shaun
Hi Shaun,
There is no way to cancel a running query with the client/server architecture. The reason is that the socket communication is unidirectional: Once a job has been sent to the the server, the response will be retrieved, and no other command can be sent in parallel.
If you do not need admin permissions, you can set a global timeout via the TIMEOUT option [1].
Hope this helps, Christian
Quoted text · Shaun Flynn · 9 lines
On Tue, Jun 26, 2018 at 1:41 PM Shaun Flynn <scfy12 at googlemail.com> wrote: > > Hello there, > > I have had a look in the documentation and was wondering, is it possible to cancel a query once it has been submitted using ClientQuery/ClientSession? > > Would calling close() on ClientQuery do that? > > Shaun
Written for BaseX 9.0. BaseX may have changed since: please check the current documentation.