SQL/MX Programming Manual for Java
SQL/MX Programming Considerations
HP NonStop SQL/MX Programming Manual for Java—523726-003
4-30
Recommended Recompilation Settings for OLTP
Programs
Controlling Automatic Recompilation
By default, automatic recompilation is enabled for all SQLJ programs. To disable
automatic recompilation at run time and force the explicit recompilation of DML
statements, use the CONTROL QUERY DEFAULT statement with the
AUTOMATIC_RECOMPILATION option set to OFF:
#sql [ctx] {CONTROL QUERY DEFAULT
AUTOMATIC_RECOMPILATION 'OFF'};
Automatic recompilation remains OFF until the end of the SQLJ program or until the
occurrence of a CONTROL QUERY DEFAULT statement with
AUTOMATIC_RECOMPILATION set to ON.
Controlling Automatic Recompilation Messages
By default, to comply with the ANSI standard, the SQL/MX executor does not return a
warning message to the program when a DML statement is automatically recompiled.
SQL/MX always logs a warning event, SQL/MX message 505, in the Event
Management Service (EMS) log when a statement is automatically recompiled. For
more information, see the EMS Manual and Operator Messages Manual.
To return recompilation warning messages directly to the program, use a CONTROL
QUERY DEFAULT statement with the RECOMPILATION_WARNINGS option set to
ON:
#sql [ctx] {CONTROL QUERY DEFAULT RECOMPILATION_WARNINGS 'ON'};
If the similarity check fails and RECOMPILATION_WARNINGS is ON, the SQL/MX
executor returns warning message 8579 to the program. If a DML statement is
automatically recompiled and RECOMPILATION_WARNINGS is ON, the SQL/MX
executor returns warning message 8576 to the program.
Recommended Recompilation Settings for OLTP Programs
For optimal performance of OLTP programs in a production environment, use these
settings:
A similarity check is faster than automatic recompilation and can reduce the
performance costs of automatic recompilation. Therefore, you should enable similarity
checks for OLTP programs.
Because automatic recompilation incurs a performance cost, it is unsuitable for OLTP
programs and should be disabled. If you allow automatic recompilations but control the
database environment to prevent them from occurring, you should monitor the EMS log
Default Attribute Value
SIMILARITY_CHECK ON
RECOMPILATION_WARNINGS OFF
AUTOMATIC_RECOMPILATION OFF