First of all, great work you guys, thanks much.
We use BaseX 7.3 in client/server mode for concurrency purposes and have
several databases. We have an updating function which updates the XML
database after the initial creation to make sure the attributes are setup
for faster querying. Here is the function:
declare updating function local:processVMs($dbName as xs:string){
let $doc := doc($dbName)
let $vms := $doc/root/proj/VM
return if (empty($vms/@desktopId)=true()) then (
for $vm in $vms
let $desktopId := local:get-desktop-id-from-vm($vm) (: function
not provided here:)
return
insert node (attribute {'desktopId'} {string($desktopId)},
'text', <VM/>) into $vm) else ()
};
This function takes a minute to run when there are about 3000 objects.
While this query runs, BaseX queues all other xqueries (including read
xqueries on other databases too) and thereby rendering the server
unresponsive until this update query is done. Due to this even the queries
that are running on other databases become unresponsive and our application
looks frozen until this update query is done.From reading old email
archives here, I see that BaseX transaction monitor will queue all requests
when update query is processed as multiple dbs can be updated using one
xQuery.
Is this really true and is there any way to hint transaction monitor to
lock only the database that is being updated and not the entire server?
Thanks,
Srini