Changes

Jump to navigation Jump to search
128 bytes added ,  14:31, 23 June 2020
{{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. If a Java function performs sensitive operations, it is advisable to explicitly lock the code. This can be realized via locking annotationswith a lock annotation:
<syntaxhighlight lang="java">
@Lock("HEAVYIO")
public void read() {
// ...
}
 
@Updating
@Lock("HEAVYIO")
public void write() {
</syntaxhighlight>
If When an XQuery expression calls the Java {{Code|write()}} function writes or updates data, a every other query that calls {{Code|write lock should ()}} or {{Code|read()}} needs to wait for the query to be enforced via a finished. If {{FunctionCode|Update|update:outputread()}} is called, only those queries are queued that call: <syntaxhighlight lang="java">java-module:{{Code|write() => update:output()</syntaxhighlight>}}.
More details on parallel query execution can be found in the article on [[Transaction Management]].
Bureaucrats, editor, reviewer, Administrators
12,250

edits

Navigation menu