SQL/MX Programming Manual for Java

Program and Module Management
HP NonStop SQL/MX Programming Manual for Java523726-003
6-10
Avoiding Possible Naming Conflicts
Avoiding Possible Naming Conflicts
Naming conflicts might occur when you customize an SQLJ program contained in a
JAR file. If JAR files reside in the same directory and contain classes that share the
same name, more than one profile within these JAR files will share the same name.
When more than one profile has the same name, naming conflicts might occur among
the module definition files and module files.
If you choose to produce module definition files (.m) and you do not specify a distinct
package name for each class, the SQLJ customizer generates module definition files in
the same directory as the JAR file and overwrites each module definition file that has
the same name. The overwritten module definition files lead to unpredictable results
during SQL compilation of the modules.
If you rely on system-defined module names, which are based on the profile name, and
use the same catalog and schema names for modules of different classes, you might
produce different modules that share the same name. These modules overwrite each
other in the /usr/tandem/sqlmx/USERMODULES directory and lead to unpredictable
results during the execution of applications.
To avoid possible naming conflicts:
Process the SQLJ program without generating module definition files. For more
information, see Default Processing Without Module Definition Files on page 1-9
and Commands for Processing Without Module Definition Files on page 5-2.
Use different package names in the package statements of classes that share the
same name. For more information, see Specifying the Java Package of an SQLJ
Program on page 3-4.
Use the MODULE directive in the source code to specify unique module names.
For more information, see MODULE Directive on page 4-12.