I use BaseX 7.7 build from couple days ago with GLOBALLOCK=false. I run using client-server mode.
I have one long running read-only xQuery (say query1) that needs to be optimized but for now it takes about 3 minutes to run. While query1 is running all other read-only xQueries are queued up (from BaseX server logs) and wait for query1 completion. After query1 is done, all other xQueries get executed one after the other.
Note query1 only accesses one document and all other xQueries run in parallel operate on a different document.
Before I debugged this more, can you let me know if a read-only query can block other read-only query? and if so any hints at where I should look at?
I am also in the process of debugging this more, so if I can get a sample code ready, I will share with you guys soon for making this easy.
Thanks, Srini
Hi Srini,
plain XQuery read-only queries should not block others. Reason for blocking could be you're using some XQuery method where it's hard or impossible to tell which databases get accessed. An example would be `xquery:eval(…)` which will acquire a global write lock due to it's generally unpredictable access behavior.
Can you post the queries on the list (or send me as private message)?
Kind regards from Lake Constance, Germany, Jens
Hi Jens,
Yes I can send you the query in a private message.
All our queries are invoked by a function call so you are right when you mentioned it might be hard to figure out which database is used from the query.
For example almost all our queries use the following structure:
*Function Call:* import module namespace Rule1 = "http://www.rule.com/xquery/Rule1" at "rulesFolder/Rule1.xq" ; Rule1:execute((<context><doc.id>doc1</doc.id></context>))
*Rule1.xq is defined as * . . . declare function Rule1:create-findings($context as element()) as node() { let $doc := doc($context/doc.id) let $findings := <perform something here to get results using $doc> return <findings> {$findings} </findings> };
declare function Rule1:execute($context as element()) as node() { <analysisResult> {Rule1:create-findings($context)} </analysisResult> };
Is global lock needed for non-update function calls too, as one can determine if the function is an update function or not from its declaration?
Thanks, Srini
On Wed, Jun 26, 2013 at 7:44 AM, Jens Erat jens.erat@uni-konstanz.dewrote:
Hi Srini,
plain XQuery read-only queries should not block others. Reason for blocking could be you're using some XQuery method where it's hard or impossible to tell which databases get accessed. An example would be `xquery:eval(…)` which will acquire a global write lock due to it's generally unpredictable access behavior.
Can you post the queries on the list (or send me as private message)?
Kind regards from Lake Constance, Germany, Jens
-- Jens Erat
PGP: 350E D9B6 9ADC 2DED F5F2 8549 CBC2 613C D745 722B
Am 26.06.2013 um 16:29 schrieb Srinivasan Muthu newsrini@gmail.com:
I use BaseX 7.7 build from couple days ago with GLOBALLOCK=false. I run
using client-server mode.
I have one long running read-only xQuery (say query1) that needs to be
optimized but for now it takes about 3 minutes to run. While query1 is running all other read-only xQueries are queued up (from BaseX server logs) and wait for query1 completion. After query1 is done, all other xQueries get executed one after the other.
Note query1 only accesses one document and all other xQueries run in
parallel operate on a different document.
Before I debugged this more, can you let me know if a read-only query
can block other read-only query? and if so any hints at where I should look at?
I am also in the process of debugging this more, so if I can get a
sample code ready, I will share with you guys soon for making this easy.
Thanks, Srini _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Jens Erat
PGP: 350E D9B6 9ADC 2DED F5F2 8549 CBC2 613C D745 722B
basex-talk@mailman.uni-konstanz.de