Hi list!
Just discovered sth. unexpected: Every query executed in dba Queries causes a global read lock. Also other (very simple) queries using RESTXQ which use a DB explicit in the query are executed with a global read lock.
Is this intentional? Is this just a side effect? I noticed that internally the code I run is wrapped in an xquery:eval. Maybe this causes this lock?
Or does every RESTXQ cause a global read lock?
I ran into this because I wanted to execute async code using this interface using the jobs module and then wait for the result. This of course locks up as soon as any access to data in dbs is attempted.
Best regards
Omar Siam
Hi Omar,
Is this intentional? Is this just a side effect? I noticed that internally the code I run is wrapped in an xquery:eval. Maybe this causes this lock?
Yes, that’s a known behavior. If xquery:eval is invoked, it is not possible to know in advance which databases will be opened by that command.
However, with BaseX 9 (and the latest snapshot), it is possible to start queries as jobs from the Files panel. This way, no global locks will be assigned (provided that the query allows for the static detection of accessed databases). Once WebSockets will be available [1], we plan to rewrite the Query panel to also use jobs:eval instead of xquery:eval.
Just discovered sth. unexpected: Every query executed in dba Queries causes a global read lock. Also other (very simple) queries using RESTXQ which use a DB explicit in the query are executed with a global read lock.
Dou you have an example?
Cheers, Christian
basex-talk@mailman.uni-konstanz.de