This section contains points that should be considered regarding Java applications. These are as follows:
Use JDK7 to develop the Java function.
Implement methods that are to be called as Java functions as static.
Do not use variable arguments as method arguments.
Only a single row can be returned as the return value.
In Java applications, the auto commit mode for transactions is 'off' by default. You can change it using the setAutoCommit method, as necessary.
Standard output and standard error output
If a Java application outputs to the standard output or to the standard error output, then it will be redirected to the server log of the container.
File output
In Java applications, the directories below are used as the current directory.
If files are output using an absolute path, ensure that the output directory is secure.
Linux
domainRoot(*1)/nodes/localhost-domain1/[serverInstanceName]/current
Java application are started by an instance administrator user, which must have file access privileges.
Windows(R)
domainRoot(*1)\nodes\localhost-domain1\serverInstanceName\current
*1: domainRoot is the directory that stores the domain resources (refer to "PL/extJava Configuration" in the Operation Guide for details).
The following system administrator functions will wait until the execution of the Java application completes:
pg_terminate_backend
pg_cancel_backend
Java applications run as transactions that are not dependent on the caller. For this reason, if the caller transaction is rolled back, the Java application transaction will not be rolled back.
Additionally, if an error occurs in the Java application, it will be output to the server log of the container (refer to "PL/extJava Log Information" in the Operation Guide for details).