NonStop Server for Java 5.0 Programmer's Reference
SPT_ABORTTRANSACTION()❍
SPT_BEGINTRANSACTION()❍
SPT_ENDTRANSACTION()❍
SPT_RESUMETRANSACTION()
Note: The Open System Services Programmer's Guide says that the maximum concurrent
transactions allowed in a process is 100; however, the JVM is an exception where the
maximum allowed is 1000 as described under Controlling Maximum Concurrent
Transactions.
❍
When calling a C or C++ routine, where the function passes or returns parameters of type float or
double, NonStop Server for Java 5 performs no conversion. All float and double values remain in IEEE
floating-point format when crossing the JNI boundary. For more information, see IEEE Floating-Point
Implementation.
●
When using the JNI_OnLoad function, use the following format:
JNI_OnLoad
●
The JNI_OnUnload function is supported by NonStop Server for Java 5 on NS-series servers, but not
supported on S-series servers.
●
When naming library files, observe the following rules:
Do not use names that begin with Tandem, tandem, or tdm.●
NonStop Server for Java 5 requires that all DLLs be named with a prefix lib and a sufix .so. So you
must name your DLL as follows:
libname.so
where (name) signifies the string that is passed to the System.loadLibrary() call.
libname.so
●
The remainder of this subsection explains:
Calling C or C++ Methods from Java●
Calling Java Methods from C or C++●
Linker and Compiler Options●
For more information about JNI, see the Sun Microsystems JNI document
(http://java.sun.com/j2se/1.5.0/docs/guide/jni/index.html).
Calling C or C++ Methods from Java
To call C or C++ methods from Java, follow these steps:
Compile the Java code.1.
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.
2.
Compile the C or C++ code. C++ code must be compiled using the following compiler command-line
options: -Wversion2 or -Wversion3, and -WIEEE_float.
If the native code has large variables on the stack, calling this native code might exceed the default stack
space provided for each thread. If the native code exceeds the amount of stack space allocated for it,
unpredictable results can occur. To prevent overflowing the available stack space, consider allocating large
variables on the heap rather than using the stack. Otherwise, you can increase the default stack size for each
3.










