By default, Java functions code, which is imported and invoked from XQuery, will be called executed in parallel with the execution of other queriescode. However, if a Java function performs sensitive write operations, it is advisable to explicitly lock the code. This can be realized via locking annotations: