SQL/MX 3.2 Guide to Stored Procedures in Java (H06.25+, J06.14+)

Getting Started
HP NonStop SQL/MX Release 3.2 Guide to Stored Procedures in Java691166-001
2-8
JVM Startup Options for Each SPJ Caller
Scope of JVM Startup Options in an SPJ Method
A UDR_JAVA_OPTIONS setting within an SPJ method does not affect the SPJ
environment in which the SPJ is executing. It affects only the SPJ environment of
CALL statements that the SPJ method executes. In general, avoid nesting CALL
statements in an SPJ. For more information, see Nested Java Method Invocations on
page 3-6.
Scope of JVM Startup Options in Statically Compiled
Applications
The UDR_JAVA_OPTIONS setting in a statically compiled CONTROL QUERY
DEFAULT statement affects statically compiled CALL statements in the line order
scope of the application.
For example, this CONTROL QUERY DEFAULT statement in an embedded SQL
program in C affects the maximum Java heap size of the SPJ environment in which the
next statically compiled CALL statement executes:
/* Set application-specific system properties for
/* the SPJ environment. */
EXEC SQL CONTROL QUERY DEFAULT UDR_JAVA_OPTIONS '-Xmx32M';
/* Call the stored procedure. */
EXEC SQL CALL samdbcat.sales.lowerprice();
/* Turn off the application-specific system properties for
/* the SPJ environment. */
EXEC SQL CONTROL QUERY DEFAULT UDR_JAVA_OPTIONS 'OFF';
/* Call the stored procedure. */
EXEC SQL CALL samdbcat.sales.lowerprice();
...
CALL statements that are statically compiled after the CONTROL QUERY DEFAULT
statement turns off the UDR_JAVA_OPTIONS setting execute in an SPJ environment
without application-specific startup options.
For more information about the semantics of static CONTROL statements in
embedded SQL programs, see the SQL/MX Programming Manual for C and COBOL
or the SQL/MX Programming Manual for Java.
Scope of JVM Startup Options in Dynamically Compiled
Applications
The UDR_JAVA_OPTIONS setting in a dynamically executed CONTROL QUERY
DEFAULT statement affects CALL statements that are dynamically prepared after the
CONTROL QUERY DEFAULT statement has executed.