By default, Java functions will be called in parallel with the execution of other queries. However, if a Java function performs sensitive write operations, it is advisable to explicitly lock the code. This can be realized via Lock locking annotations: