Troubleshooting
Problem
This document explains known restrictions with the native optimizations of Record Level Access classes of the IBM Toolbox for Java.
Resolving The Problem
The IBM Toolbox for Java record level access (RLA) classes are enabled for IBM i JVM optimization. When the native optimizations are used, the RLA classes are run in the scope of the current job rather than in a separate DDM host server job (QRWTSRVR). Therefore, all resources such as open files, record locks, and commitment definitions are scoped to the current job rather than the server job. Before you take advantage of the native optimizations, application developers must take the scope rules into consideration and verify that conflicts do not occur.
Example 1
One example of a conflict involves SQL Server mode jobs. IBM i does not allow a commitment definition to be created in a job that starts SQL server mode processing. SQL Server mode is started whenever a native JDBC connection or CLI connection (in server mode) is made in the job. Therefore, an application cannot mix RLA calls that run under an isolation level other than *NONE with native JDBC or CLI. For example, if an IBM WebSphere application has one servlet that uses RLA classes and another servlet running native JDBC, the two servlets cannot run in the same application server. If they do, the job might encounter the error CPF8366 as shown here:
The job log shows the CPF8366 preceded by SQL7908 indicating that CLI server mode is also being used. This type of application must not use the native optimizations for record level access.
Example 2
Another problem with Record Level Access (RLA) classes and native optimizations happens when the system value for multi-threaded jobs (QMLTTHDACN) is set to a value of 3 (Do not perform the function that is not threadsafe). In this environment, failures can occur with certain RLA class methods that cause commands that are not threadsafe to be called. For example, the AS400FileRecordDescription.retrieveRecordFormat() method uses the DSPFFD command to retrieve record formats. Because this command is not threadsafe, the following sequence of messages occurs:
CPD000D - Command *LIBL/DSPFFD not safe for a multithreaded job.
CPF0001 - Error found on DSPFFD command.
CPF0006 - Errors occurred in command.
Resolution
To disable native optimizations completely, remove the appropriate JAR file from the class path and use only jt400.jar. To disable optimization on a per connection basis, use the setMustUseSockets() method with a value of true on the AS400 system object.
Example 1
One example of a conflict involves SQL Server mode jobs. IBM i does not allow a commitment definition to be created in a job that starts SQL server mode processing. SQL Server mode is started whenever a native JDBC connection or CLI connection (in server mode) is made in the job. Therefore, an application cannot mix RLA calls that run under an isolation level other than *NONE with native JDBC or CLI. For example, if an IBM WebSphere application has one servlet that uses RLA classes and another servlet running native JDBC, the two servlets cannot run in the same application server. If they do, the job might encounter the error CPF8366 as shown here:
CPF8366 Escape 40 22/09/02 16:59:15 QTNCTL QSYS 05DB QYJSPART QSYS
To module . . . . . . . . . : QYJSPCMD
To procedure . . . . . . . : command
Statement . . . . . . . . . : 1397
Thread . . . . : 0000010D
Message . . . . : Commitment definition *N not created.
Cause . . . . . : Commitment definition *N could not be created because the
maximum number of commitment definitions allowed for a job has already been
reached. The maximum number of commitment definitions allowed for this job
is 0. If the maximum number is 0, no commitment definitions are allowed to
be started because SQL server mode processing has been started. Recovery .
. . : No recovery. The job log shows the CPF8366 preceded by SQL7908 indicating that CLI server mode is also being used. This type of application must not use the native optimizations for record level access.
Example 2
Another problem with Record Level Access (RLA) classes and native optimizations happens when the system value for multi-threaded jobs (QMLTTHDACN) is set to a value of 3 (Do not perform the function that is not threadsafe). In this environment, failures can occur with certain RLA class methods that cause commands that are not threadsafe to be called. For example, the AS400FileRecordDescription.retrieveRecordFormat() method uses the DSPFFD command to retrieve record formats. Because this command is not threadsafe, the following sequence of messages occurs:
CPD000D - Command *LIBL/DSPFFD not safe for a multithreaded job.
CPF0001 - Error found on DSPFFD command.
CPF0006 - Errors occurred in command.
Resolution
To disable native optimizations completely, remove the appropriate JAR file from the class path and use only jt400.jar. To disable optimization on a per connection basis, use the setMustUseSockets() method with a value of true on the AS400 system object.
[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Data Access","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]
Historical Number
28170954
Was this topic helpful?
Document Information
Modified date:
07 July 2021
UID
nas8N1016833