Locks are not synchronized between multiple BaseX instances. We generally recommend working with the client/server architecture if concurrent write operations are to be performed.
==External Side Effects==
Access to external resources (files on hard disk, HTTP requests, ...) is not controlled by BaseX' transaction monitor unless specified by the user.
===XQuery Locking Options===
Custom locks can be acquired by setting the BaseX-specific XQuery options {{Code|query:read-lock}} and {{Code|query:write-lock}}. It accepts arbitrary strings, for locking. The option may be set multiple times to acquire multiple locks, or use a colon as separator between them. These locks are in another namespace than the database names, locking "factbook" using the options does not lock the database named factbook.
These options will put read locks on ''foo'', ''bar'' and ''batz'' and a write lock on ''quix''.
<pre class="brush:xquery">declare option query:read-lock "foo,bar";
declare option query:read-lock "batz";
declare option query:write-lock "quix";</pre>
==Limitations==