In a multi-engine environment, certain Java/SQL commands can negatively affect performance. This typically happens when the same Java method executes multiple times within a SQL loop. To avoid this, write Java/SQL commands so that the method and the loop are executed in the VM context:
Write loop in Java.
Call method from Java-coded loop.