Changes

Jump to navigation Jump to search
402 bytes added ,  10:20, 21 May 2019
* {{Code|collection('db/path/to/docs')}}, read-locking of "db"
* {{Code|fn:sum(1 to 100)}}, locking nothing at all
* {{Code|delete nodes docdb:open('test')//*[string-length(local-name(.)) > 5]}}, write-locking of "test"
All databases A global lock will be locked by queries assigned if the name of the following kinddatabase is not a static string:
* {{Code|for $db in ('db1', 'db2') return docdb:open($db)}}
* {{Code|doc(doc('test')/reference/text())}}
* <code>let $db := 'test' return insert nodes <test/> into docdb:open($db)</code> The functions [[Databases#XML Documents|fn:doc]] and [[Databases#XML Documents|fn:collection]] can also be used to address that are not stored in a database. You have two options to reduce the number of locks that are triggered by these functions. No database lookups will take place if {{Function|Fetch|fetch:xml}} is used, or if {{Option|WITHDB}} option is disabled.
You can consult the query info output (which you find in the [[GUI#Visualizations|Info View]] of the GUI or which you can turn on by setting {{Option|QUERYINFO}} to {{Code|true}}) to find out which databases have been locked by a query.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu