Changes

Jump to navigation Jump to search
170 bytes removed ,  13:08, 23 June 2020
==Locking==
{{Mark|Updated with Version 9.4:}} Single annotation for read and write locks. By default, a Java function will be executed in parallel with other code. However, if If a Java function performs sensitive write operations, it is advisable to explicitly lock the code. This can be realized via locking annotations:
<syntaxhighlight lang="java">
@Lock(write = { "HEAVYIO" })
public void write() {
// ...
}
</syntaxhighlight>
 
If the function writes or updates data, a write lock should be enforced via a {{Function|Update|update:output}} call:
@Lock(read <syntaxhighlight lang= { "HEAVYIOjava" }>java-module:write() public void read=> update:output() { // ... }
</syntaxhighlight>
If an XQuery expression is run which calls the Java {{Code|write()}} function, every other query that calls {{Code|write()}} or {{Code|read()}} needs to wait for the query to be finished. If a query calls the {{Code|read()}} function, only those queries are queued that call {{Code|write()}}, because this function is only annotated with a {{Code|read}} lock. More details on parallel query execution can be found in the article on [[Transaction Management]].
==Data Types==
Bureaucrats, editor, reviewer, Administrators
12,250

edits

Navigation menu