This is exactly what I was looking for, thanks!
George
On 07/11/2017 03:02 PM, Christian Grün wrote:
Hi George,
It’s recommendable indeed to only create one instance of the Context class. Context instances are lightweight, but operations like transactions are centrally controlled by this class. QueryProcessor are usually created anew for each query evaluation.
Number of jobs… Just start in the Context class and follow the JobPool reference. Via the PARALLEL option [1], you can set a maximum limit of parallel database transactions. If you want to enforce that there are never more than transactions running, you can set FAIRLOCK [2] to true.
I’ve just updated the description of the PARALLEL option to indicate what has changed since the introduction of the FAIRLOCK option.
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Options#PARALLEL [2] http://docs.basex.org/wiki/Options#FAIRLOCK
On Tue, Jul 11, 2017 at 11:36 AM, George Sofianos gsf.greece@gmail.com wrote:
Hello,
I'm building a web service that along with some other things (XML Validation, Saxon XQuery, etc) includes a BaseX processor for running XQuery scripts. I'm wondering what is the best way to use an embedded BaseX processor. Can some objects be shared (e.g Context, QueryProcessor), or are they very lightweight and there is no need to share / reuse ? Can I get the number of the jobs running and the job status like in the client / server mode? My intention is to make sure I can limit the amount of the jobs running in parallel, and have more control over the execution (maybe cancel jobs if necessary)
Thanks,
George