hello all,
i’m trying to implement a cancel function in my java client in order to allow a user to cancel a search when it takes too long. I have encapsulated all the process of connecting + querying + getting the results in a thread called from my client. So i check between each step if the thread has been interrupted.
Unfortunately, once the step TResponse response = accessor.xquery(query,PAGE_SIZE); has been launched (and it’s often the longest step), i’m forced to wait the end of it before being able to treat the cancelling.
Does it exist a way to be informed of something during this method is running ? How can i do that ?
thanks in advance for any lead.
thomas
ps : it’s maybe more a java question than a tamino one, but on doesn’t know. Maybe someone has already implemented something like that here…
With Tamino v4.4 it is possible to cancel a request. See ino:Accessor in the “Requests using X-Machine Commands” chapter of the Tamino documentation.
If the request takes a long time to fetch data but you want the client to have control whilst waiting for the results then you could utilise techniques such as Ajax.
Hope this helps.
thanks Stuart for the quick answer,
unfortunately i’m working with tamino 4.2.1. Do you know if cancel is possible with this version ?
what do you mean by “techniques such as Ajax”, is it something easy to build (i’m programming a swing client for only one user at a time, and i’m not really an “up to date” programmer…)
thomas
unfortunately i’m working with tamino 4.2.1. Do you know if cancel is possible with this version ?
don’t need to answer : i just found the release note for 4.4.1 that says “Currently it is not possible to stop requests sent to Tamino through the Tamino API for Java. Once started, a query executes (i.e., consumes CPU cycles, main memory, and IO capacity) until all results are delivered or until an error condition is encountered. The user has no chance to cancel a long running request (and thus stop resource consumption).
In the current version of Tamino (i.e. 4.4.1), the server provides this feature. Application-owned requests can be cancelled using the Tamino API for Java.”
thomas