NonStop Server for Java 7.0 Programmer's Reference
the POSIX User Thread (PUT) Model Library” section in the Open System Services Programmer's
Guide. The calls are:
◦ PUT_ABORTTRANSACTION()
◦ PUT_BEGINTRANSACTION()
◦ PUT_ENDTRANSACTION()
◦ PUT_RESUMETRANSACTION()
NOTE: OSS supports a maximum of 1000 concurrent transactions in a process.
However, JVM is an exception where the maximum transactions allowed are 200 as
described in “Controlling maximum concurrent transactions” (page 82).
• NSJ7 performs no conversion when calling a C or C++ routine where the function passes or
returns parameters of type float or double. All float and double values remain in IEEE
floating-point format when crossing the JNI boundary. For more information, see “Floating-point
implementation” (page 39).
• When using the JNI_OnLoad function, use the following format:
jint JNI_OnLoad(JavaVM *vm, void *reserved);
• The JNI_OnUnload function is supported.
• Conform to the following rules when naming user DLLs:
Do not use names that begin with Tandem, tandem, or tdm.◦
◦ NSJ7 requires that all DLLs be named with a prefix lib and a suffix .so. Hence you
must name your DLL as follows:
libname.so
where, (name) signifies the string that is passed to the System.loadLibrary
() call.
The remainder of this subsection explains:
• “Calling C or C++ routines from Java” (page 36)
• “Calling Java methods from C or C++” (page 37)
• “Linker and compiler options” (page 38)
For more information about JNI, see Oracle JNI document.
Calling C or C++ routines from Java
To call C or C++ routines from Java, conform to the following steps:
1. Compile the Java code.
2. Use javah to generate header files— The function declarations listed in the generated header
file are those that must be exported by the user-JNI DLL.
To export functions, either specify export$ in the function definition or use the linker option
-export_all.
3. Compile the C or C++ code— C++ code must be compiled using the compiler command-line
options as explained in “Linker and compiler options” (page 38).
For example:
/usr/bin/c89 -g -I /usr/tandem/nssjava/jdk170_h70/include -I /usr/tandem/nssjava/jdk170_h70/include/oss
-I. -I /G/system/system -Wallow_cplusplus_comments -Wlp64 -Wextensions -D_XOPEN_SOURCE_EXTENDED=1
-Wnowarn=141,209 -Wcall_shared -Wsystype=oss -Wtarget=tns/e -c SystemInfo.c
36 Implementation specifics










