SQL/MX Guide to Stored Procedures in Java (G06.24+, H06.03+)

Introduction
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
1-19
Maintaining Class and JAR Files in an SPJ
Environment
If an application class does not change on disk during an active SPJ environment,
identical copies of the application class exist in memory and could waste resources. To
conserve system resources, design your Java classes and directory structure so that
fewer SPJ methods in different external paths rely on the same application class.
If an application class changes on disk during an active SPJ environment, copies of old
and new versions of the application class could be in memory at the same time,
leading to unpredictable and undesirable behavior of CALL statements. To prevent this
problem, stop the calling application, which ends the SQL/MX UDR server process,
install the updated class or JAR file, and then restart the application.
Figure 1-8. Copies of Java Classes in SPJ Class Loaders
VST008.vsd
SQL/MX UDR Server Process
SPJ Environment
SPJ Class Loader X
for External Path
'/usr/myapps'
Loads...
SPJA
EXTERNAL NAME:
'pkg1.subpkg1.myClass1.myMethod1()'
EXTERNAL PATH:
'/usr/myapps'
CALL...
Refers to...
SPJ Class Loader Y
for External Path
'/usr/myapps/myJar.jar'
Loads...
SPJB
EXTERNAL NAME:
'pkg2.subpkg2.myClass2.myMethod2()'
EXTERNAL PATH:
'/usr/myapps/myJar.jar'
CALL...
Refers to...
Each SPJ class loader loads its own copy
of an application class.
Application Class
other.class in the
/usr/otherapps class path
Updated Application Class
other.class in the
/usr/otherapps class path
Copy of
Application
Class
other.class
Copy of
Updated
Application
Class
other.class