NonStop Server for Java 6.0 Programmer's Reference HP Part Number: 546595-006 Published: August 2013 Edition: J06.04 and all subsequent J-series RVUs and H06.
© Copyright 2010, 2013 Hewlett-Packard Development Company L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice.
Contents About this Manual.........................................................................................7 Manual Information..................................................................................................................7 Intended Audience....................................................................................................................7 New and Changed Information..................................................................................................
Additional Files......................................................................................................................43 Additional Environment Variable...............................................................................................43 Java Native Interface (JNI).......................................................................................................43 Calling C or C++ Methods from Java...............................................................................
javax.transaction Exceptions................................................................................................74 Examples..........................................................................................................................74 6 Application Profiling.................................................................................76 Monitoring live Java applications..............................................................................................
Tables 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Document Structure..........................................................................................................12 Headless Support for Visual Feature Packages.....................................................................23 Subdirectories of the /usr/tandem/java Directory...........................................................41 Demonstration Programs................................................................................................
About this Manual This section explains these subsections: • “Manual Information” (page 7) • “Intended Audience” (page 7) • “New and Changed Information” (page 8) • “Document Organization” (page 12) • “Notation Conventions” (page 12) • “Related Reading” (page 14) • “Revision History” (page 20) • “HP Encourages your Comments” (page 20) • “Printing this Document” (page 20) • “Abbreviations” (page 20) Manual Information Abstract This document describes the HP NonStop ™ Server for Java ™, ba
For Java programmers who want to determine application performance and behavior, this manual describes how to use the HPeprof and HPROF profilers to obtain runtime information for a NonStop Server for Java 6.0 program and also analyze profile data using the HPjmeter. For developers new to NonStop systems, this document: • Explains NonStop system fundamentals as they apply to the NonStop Server for Java 6.0 product. • Refers to other appropriate NonStop system documentation.
• Updated the content for the section “Managing Node Agents on a NonStop Operating System” (page 89). • Added new sub-section “Checking for Application Paging Problems” (page 89).
NOTE: If the JREHOME environment variable is set, Java installed in the location pointed by $JREHOME directory will take precedence. • The Dnsk.java.fastExec=true option reduces the latency of the Java Runtime.exe()API, which isused to spawn a child process. • The Dynamic saveabend file creation feature helps to create a saveabend file of a running Java process without aborting the Java process.
Feature Changes NonStop Server for Java 6.0 supports the following features: • Non-Blocking I/O for OSS regular files feature in Java applications. By default, this feature is enabled on NSJ6.0. It allows performing regular I/O operations on multiple OSS files simultaneously, thereby enhancing the performance of standard I/O operations on OSS regular files. To disable this feature, use the -Dnsk.java.nonblocking=false option.
◦ Nonblocking I/O APIs ◦ -Xeprof option ◦ -XX:+HeapDump option ◦ -XX:+HeapDumpOnOutOfMemoryError command line option Documentation Changes This is a new manual for NonStop Server for Java 6.0. Document Organization This document includes the following sections: Table 1 Document Structure Section Description “Introduction to NonStop Server for Java 6.0” (page 22) Explains NonStop software fundamentals as they apply to NonStop Server for Java 6.
Computer Type Computer type letters within text indicate keywords, reserved words, command names, class names, and method names; enter these items exactly as shown. For example: myfile.c Italic Computer Type Italic computer type letters in syntax descriptions or text indicate variable items that you supply. For example: pathname [ ] Brackets Brackets enclose optional syntax items. For example: jdb [options] A group of items enclosed in brackets is a list from which you can choose one item or none.
Line Spacing If the syntax of a command is too long to fit on a single line, each line that is to be continued on the next line ends with a back slash ( \ ) and each continuation line begins with a greater-than symbol ( > ). For example: /usr/bin/c89 -c -g -I /usr/tandem/java/include \ > -I /usr/tandem/java/include/oss -I . \ > -Wextensions -D_XOPEN_SOURCE_EXTENDED=1 jnative01.
NonStop Server for Java Library In addition to this manual, the NonStop Server for Java library includes: • NonStop Server for Java 6.0 Tools Reference Provides a page for each Java tool and links to the Oracle website where the detail information on that site applies. • NonStop Server for Java API Provides the API description for these packages: ◦ com.tandem.os ◦ com.tandem.tmf ◦ com.tandem.
compiler for the HP NonStop Open System Services (OSS) environment (c89) must be installed and configured correctly. Also, you might need this document if you use the Java Native Interface (JNI) to communicate between Java and a native library. • DLL Programmer's Guide for TNS/E Systems Provides an introduction to the process of creating and using Dynamic-Link Libraries (DLLs) on TNS/Esystems.
• Spooler FASTP Network Print Processes Manual Describes the Spooler FASTP network print processes, which provide the ability to use the Spooler subsystem to print documents on a printer attached to a particular type of local area network (LAN) or wide area network (WAN). • Spooler Utilities Reference Manual Presents a general introduction to the Spooler subsystem and describes the Spooler utilities—Peruse, Spoolcom, Font, RPSetup — presenting the complete syntax for these utilities.
• SQL/MX Documents NonStop Server for Java includes JDBC drivers that enable Java programs to interact with NonStop SQL databases with SQL/MX. ◦ SQL Supplement for H-series RVUs This supplement provides information about HP NonStop SQL/MP™ and HP NonStop SQL/MX that is specific to H-series release version updates (RVUs). The currently published SQL/MP and SQL/MX manuals are intended for G-series users.
• TCP/IPv6 Configuration and Management Manual Describes how to configure and manage the NonStop TCP/IPv6 subsystem on a NonStop S-series server. For IPv6 support, you must use the NonStop TCP/IPv6 subsystem with NonStop Server for Java. • TMF Documents ◦ TMF Introduction Introduces the concepts of transaction processing and the features of the HP NonStop Transaction Management Facility (TMF) product.
Revision History Part Number Product Version Published 546595-001 HP NonStop Server for Java 6.0 March 2010 546595-002 HP NonStop Server for Java 6.0 April 2010 546595-003 HP NonStop Server for Java 6.0 January 2011 546595-004 HP NonStop Server for Java 6.0 April 2011 546595-005 HP NonStop Server for Java 6.0 November 2011 546595-006 HP NonStop Server for Java 6.0 August 2013 HP Encourages your Comments HP encourages your comments concerning this document.
ISO. International Organization for Standardization J2SE. Java 2 Platform Standard Edition JAAS. Java Authentication and Authorization Service JAR. Java Archive JCK. Java Conformance Kit JDK. J2SE Development Kit JFC. Java Foundation Classes JDBC. Java Database Connectivity JDBC/MP. JDBC Driver for SQL/MP JDBC/MX. JDBC Driver for SQL/MX JNDI. Java Naming and Directory Interface JNI. Java Native Interface JPS. Java Print Service JRE. J2SE Runtime Environment JTA.
1 Introduction to NonStop Server for Java 6.0 The HP NonStop Server for Java 6.0 is a Java environment that supports compact, concurrent, dynamic, portable programs for the enterprise server. The NonStop Server for Java 6.0 requires the HP NonStop Open System Services (OSS) environment. The NonStop Server for Java 6.0 uses the HP NonStop operating system to add the NonStop system fundamentals of scalability and program persistence to the Java environment. NonStop Server for Java 6.
Java Standard Edition Development Kit (JDK) Highlights The NonStop Server for Java 6.0 consists of the following standard Java components (and the HP extensions described else where in this document): • Java virtual machine (VM) based on the J ava SE Runtime Environment (JRE) 6.0 • Core Packages of the Java ™ SE Development Kit (JDK) 6.0 • Standard Java SE 6.0 tools as documented in the NonStop Server for Java 6.0 Tools Reference Pages.
IPv6 Support The Java SE JRE 6.0 release includes Internet Protocol version (IPv6) support in Java Networking. This support makes Java SE compliant with the following standards (RFCs): • RFC2373: IPv6 Addressing Architecture • RFC 2553: BasicSocket Interface Extensions for IPv6 • RFC 2732: Format for Literal IPv6 Addresses in URLs Since the Java SE JRE does not support raw sockets, RFC 2292 (Advanced Sockets API for IPv6) is not supported in this release.
BEA WebLogic Server for the HP NonStop Server The BEA WebLogic Server is a standards-based Java 2, Enterprise Edition (J2EE) application server that provides a foundation for building applications and includes: • Load balancing • Fault tolerance • Web services • Network transparency • Legacy integration • Transaction management • Security • Multithreading • Persistence • Database connectivity • Resource pooling • Development, testing, and packaging facilities The BEA WebLogic Server
The BEA WebLogic Server for the HP NonStop Server is an application server that provides a framework for building and managing applications. WebLogic Server simplifies the development, deployment, integration, and management of applications by surrounding the latest J2EE and Web services standards with easy-to-use development and administration tools and powerful clustering, security, integration, and management features. These built-in services alleviate developers’ need to create these services manually.
Pathsend API for Java The NonStop Transaction Services/MP (NonStop TS/MP) product supports the use of Pathway servers to access NonStop SQL or Enscribe databases in an online transaction processing (OLTP) environment. Using the Pathsend API for Java, programs can send requests to these Pathway servers and receive replies from them. Pathway servers can be written in C, COBOL, or Java.
and reliability inherent in SQL/MX products to provide standards-based messaging for local clients running on NonStop servers. NSJMS enables scalability and load distribution through horizontal partitioning and fault-tolerance through process-pair technology. Features and functions of NSJMS include: • Implements the JMS API on NonStop systems. Uses the publish and subscribe features of NonStop SQL/MX.
In the SQL/MX database, a SPJ is a Java method contained in a Java class, registered in SQL/MX, and invoked by SQL/MX when an application issues a CALL statement to the method. For more information on using SPJs, see the SQL/MX Guide to Stored Procedures in Java at docs.hp.com.
2 Getting Started Although this manual assumes that you are familiar with using Java and HP NonStop Open System Services (OSS), this section provides background information for persons not familiar with these products. Additionally, this section explains how to perform common tasks that are characteristic to running Java applications on NonStop systems.
If you are familiar with using the Korn shell, you only need to peruse the Open System Services User's Guide (especially Section 2, OSS File System) for pertinent platform-specific information to get started using Java in the OSS environment. The Open System Services User's Guide The Open System Services User's Guide describes the OSS user environment; the shell, file system, and user commands. Topics of particular interest for beginning users follow.
Verifying the Java Installation Ask your system administrator where the NonStop Server for Java Server 6.0 software is installed. Knowing that, you can verify the installation and verify your environment. This example assumes that NonStop Server for Java 6.0 is installed in a nonstandard location—the /home/lee/jdk60 directory: NOTE: If your NonStop Server for Java 6.0 software is installed in the standard location (/usr/tandem), or if you are using NonStop Server for Java 6.
class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } d. Alternatively, at the OSS prompt, use the cat command to create the HelloWorld.java file and type the contents of the HelloWorld program listed previously. $cat> HelloWorld.java type-contents-of-the-file (Ctrl+y) 2. Set the JREHOME Shell Variable. If you know that the NonStop Server for Java 6.0 product is installed on your system in the standard location, you can omit this step.
c. Compile the Java source code by using the Java compiler, javac, which is part of the installed NonStop Server for Java 6.0 product. Type the following command at the OSS prompt: $javac HelloWorld.java If compilation is successful, the compiler produces a Java class file called HelloWorld.class. Once you have the class file, your program is ready to run. d. Check to see that the HelloWorld.class file has been created by typing: $ls -l HelloWorld.
Configuring a Java Pathway Serverclass The following is a brief overview of the specific Java requirements for configuring a Java program to run as a Pathway serverclass. Complete information about the topic is available in the TS/MP System Management Manual. The serverclass attributes that have specific Java requirements follow. Typically, the attribute settings would be put in a configuration file, but the examples here show setting them in the OSS environment.
$gtacl -p pathcom \$foo PATHCOM .....
3 Installation and Configuration This section explains these subsections: • “Installation Requirements” (page 37) • “Configuration Requirements” (page 37) • “NonStop Server for Java 6.0 Directory Structure” (page 41) For information about how to verify a NonStop Server for Java 6.0 installation, see “Verifying the Java Installation” (page 32). Installation Requirements Regarding hardware, NonStop Server for Java 6.
Setting Environment Variables The following subsections describes the variables that define the environment in which Java operates. PATH The environment variable PATH enables Open System Services (OSS) to find the Java executable files. As a convenience so that you do not have to fully qualify the Java executable, add the absolute path of the java/bin directory to the PATH environment variable.
Class path entries that are neither directories nor archives (.zip or .jar files) are ignored. Example: Setting Class Path in a java Command Suppose you want the Java runtime to find a class named Cool.class in the package utility.myapp. If the path to that directory is: /java/MyClasses/utility/myapp, you would set the class path so that it contains /java/MyClasses. To run that application, you could use the following java command: $java -classpath /java/MyClasses utility.myapp.
_RLD_LIB_PATH The _RLD_LIB_PATH environment variable specifies the library path for DLLs. You need to use this environment variable only if you use user DLLs. You can specify one or more directories as necessary. Separate each directory in the list by using a colon (:). Set this environment variable as follows: _RLD_LIB_PATH=dll_path[:dll_pathn]... where dll-path and dll-pathn are the directories where the user DLLs reside.
NonStop Server for Java 6.0 Directory Structure This subsection explains: • “Directory Contents” (page 41) • “Demonstration Programs” (page 41) Directory Contents The /usr/tandem/java directory contains release documents and subdirectories. Table 3 (page 41) lists the subdirectories and describes their contents. Table 3 Subdirectories of the /usr/tandem/java Directory Subdirectory Contents /bin Executable binary files that make up the JDK .
4 Implementation Specifics This section explains these subjects regarding HP implementations of NonStop Server for Java, based on Java Platform Standard Edition 6.
The following Java SE features are not applicable (and, therefore, not available): • Class data sharing (CDS), a feature intended to reduce application startup time and footprint, that is available only with a Java HotSpot client VM.
◦ SPT_ENDTRANSACTION() ◦ SPT_RESUMETRANSACTION() NOTE: The Open System Services Programmer's Guide states 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” (page 72). • When calling a C or C++ routine, where the function passes or returns parameters of type float or double, NonStop Server for Java 6.0 performs no conversion.
information about the -Xss option, see java in the NonStop Server for Java 6.0 Tools Reference Pages. 4. Create a DLL file (.so file type) and specify the linker option -set float type IEEE_float. Then set the _RLD_LIB_PATH environment variable to point to where the created DLL file resides by using the following command: export _RLD_LIB_PATH=dll-path where dll-path is the directory where the user DLL resides. For more information, see “_RLD_LIB_PATH” (page 40).
scope of this document. However, the javahjni demo shows an example of mixed modes. (For information on demos, see “Demonstration Programs” (page 41).) Linker Options When building native libraries, you must use the following linker option: –set floattype IEEE_float How to Create Your Own Library of Native Code The javahjni demonstration program that comes with NonStop Server for Java 6.0 shows how to create a native library.
How to Call TNS Floating-Point Functions from JNI Code This topic describes how to call a TNS floating-point function from an IEEE floating-point function. When using TNS floating-point compiled functions in native code linked into the java executable: • Do not call the Common Runtime Environment (CRE) functions with TNS floating-point values because CRE functions are expecting IEEE floating-point values. • Do not pass floating-point values (float and double) across mixed float compilation units.
For the NonStop system, the thread-scheduling algorithm is not preemptive; that is, a thread continues to run until it explicitly yields or otherwise causes a yield by invoking a blocking operation on the thread. However, you can assign time-slice to each thread using the –XX:ThreadTimeSlice option. When a thread gives up control, the runnable threads of the highest priority are run in first-in-first-out order.
} } On the NonStop system, the execution of threads is not time-sliced. Messages from one thread precede those from the other thread as shown below for thread 0 and thread 1. Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread #0, #0, #0, #0, #0, #0, #0, #0, #1, #1, #1, tick tick tick tick tick tick tick tick tick tick tick = = = = = = = = = = = 50000 100000 150000 200000 250000 300000 350000 400000 500000 100000 150000 When the SelfishRunner.
• Pipe I/O • TMF transactions (com.tandem.tmf package) JToolkit provides a thread-aware API for performing I/O to Enscribe files, $RECEIVE, and Pathway servers by using Pathsend procedure calls. For more information, see the JToolkit Programmer's Reference. Thread-Aware I/O Support for OSS regular files By default, the NonStop Server for Java 6.0 enables Non-Blocking I/O for OSS regular files on SUT versions J06.04 and greater and H06.15 and greater.
#define SPT_THREAD_AWARE Adding this define in the native C/C++ code, transparently provides you the thread-aware equivalents of many of the interfaces, for example, the Socket interface. Additionally, the interfaces are available to determine if a socket is read-ready (spt_fd_read_ready) or write-ready (spt_fd_write_ready). The Socket implementation on NonStop systems supports streaming; multiple sends and receives are outstanding at a time. • Be careful when using thread-aware interfaces.
.. .. ThreadDumpPath Support The execution stack trace of all Java threads in a NonStop Java 6.0 process can be dumped by sending a SIGQUIT signal to the Java process, using the following OSS command: $ kill -QUIT By default, the thread stack dump is written in text format on stdout. NSJ 6.
NOTE: • T is an optional argument. • The default value of T is 40 milliseconds. • Values of T can range between 0 to 32767. If the specified value of T is above 32767, the value is time-sliced to 32767. Java Authentication and Authorization Service (JAAS) The Java Authentication and Authorization Service (JAAS) is integrated into the NonStop Server for Java 6.0. JAAS augments the core Java 2 platform with facilities to authenticate and enforce access controls upon users.
Debugging Java Programs This subsection discusses the debugger architecture and how to run the programs involved in debugging Java applications. The topics are: • “Debugging Overview” (page 54) • “Transports” (page 55) • “java Command Line Options to Run a Debuggee” (page 55) • “Starting the Java Debugger (jdb) Tool” (page 57) • “Debugging JNI Code” (page 57) • “Debugging Java and JNI Code” (page 58) Debugging Overview NonStop Server for Java 6.
For more details, see the Sun Microsystems Java Platform Debugger Architecture Documentation (http://docs.oracle.com/javase/6/docs/technotes/guides/jpda/architecture.html). JDI specification does not provide in-process debugging. Hence, a Java based tool called a debugger is used to debug another JVM running the Java application.
-Xrunjdwp:transport=dt_socket,server=y,address=port_no,suspend=y classname arguments -Xdebug Enables debugging. -Xnoagent Disables the old Sun.tools.debug agent. This is the default. -Xrunjdwp:sub-options sub-options are specified in the following format: name1[=value1],name2.=[=value2]... The sub-options are: transport Name of the transport to use. DT_socket is the value for this option. NonStop Server for Java 6.0 defaults to DT_socket.
Example 1 Example 1: java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=4000, suspend=y classname arguments The port number is specified in this example. Example 2 Example 2: java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=4000-4050, suspend=y classname arguments The range of ports is specified in this example and the hostname is implicit.
run -debug java java_options To debug native code, load the DLL first. Visual Inspect lets you stop the program after the DLL is loaded so you can set breakpoints. You can see and debug only the native routine to be debugged and other native routines that routine calls. All other scopes above the native routine are compiled or interpreted Java code, which the inspect debugger has no knowledge about.
NOTE: The -tclient option is not valid with NonStop Server for Java 6.0. -tserv Runs the application in the Java HotSpot server VM. NOTE: -tserv is the default option for NonStop Server for Java 6.0; therefore, specifying -tserv is optional. For more information about jdb and how to start a Java program so that jdb can attach to it, see jdb in the NonStop Java 6.0 Tools Reference Pages.
Layout for Generations The generations are: • Young (also called new) generation—The JVM allocates objects in the young generation pool. Minor garbage collection happens when this young generation is full and the JVM is unable to allocate new objects. The young generation also includes two survivor spaces. One survivor space is empty at any time and serves as a destination of the next GC operation, which copies the collection of any live objects in Eden and the other survivor space.
Sets the maximum size for the permanent generation. The default value for MaxPermSize is 32 MB. The initial size of the permanent generation PermSize option is ignored. NOTE: At initialization time, the maximum size of the combined young and tenured generations and the maximum size of permanent generation are allocated. Implementation of Garbage Collector Types The default garbage collectors in NonStop Server for Java 6.
only for a parallel collector and, therefore, is disabled. If you specify this option, the JVM exits with the error: -XX:+AggressiveHeap option is not supported on this platform. -XX:GCHeapFreeLimit=space-limit Specifies the lower limit on the amount of space freed during a garbage collection in percentage of the maximum heap. -XX:GCTimeLimit=time-limit Specifies the upper limit on the amount of time spent in garbage collection in percent of total time.
-Xms : the startup size of memory allocation pool (the GC heap) -Xmx : the maximum memory allocation pool The maximum value for the NonStop system depends on the location of the QIO segment. If the segment is moved to KSEG2, the maximum value can be as high as 900 MB, otherwise, the maximum value may stay around 350 MB. For information on QIO segment location, see “Memory Considerations: Moving QIO to KSEG2” (page 66).
NOTE: • As described earlier, the NonStop Server for Java 6.0 does not support the throughput collector (specified with the option –XX:+UseParallelGC) or the concurrent low pause collector (specified with the option –XX:+UseConcMarkSweepGC). • Also, the following options do not apply either for the NonStop Server for Java 6.0 or the NonStopsystem: -XX:+UseBoundThreads — Option to bind user level threads; Solaris specific -XX:+UseAltSigs — Solaris specific.
to stdout is suppressed. Setting the _JAVA_BINARY_HEAPDUMP environment variable along with _JAVA_HEAPDUMP_ONLY produces a binary format heap dump and instead of ASCII, the SIGWINCH is sent to the process. NOTE: Before producing the heap dump, JVM performs a full GC. Other HeapDump Options In addition to -XX:+HeapDump, there are three other HeapDump options available: -XX:+HeapDumpOnCtrlBreak, -XX:+HeapDumpOnOutOfMemoryError, and -XX:+HeapDumpOnly. The following table lists the heap dump options.
dump information. If the -XX:+HeapDumpOnly option is specified or the _JAVA_HEAPDUMP_ONLY environment variable is set, the heap dump functionality is triggered by sending SIGWINCH to the process. The printing of thread and trace information to stdout is suppressed. The heap dump is written to a file with the following filename format: java___
When a process uses the parallel TCP/IP transport provider for socket operations (like the iTP Secure WebServer httpd daemon Server process instance), the process becomes a QIO client. For NonStop™ Server QIO shared-memory segments, when a QIO client process makes a socket request, a portion of the process address space is reserved for the QIO segment. This reserved space limits the maximum usable heap size for the JVM process.
Current Pool Alloc..... 4516992 Max Pool Alloc.......... 4715520 Current Pool Frags..... 375 Max Pool Frags.............. 382 The QIO segments on this system (\GOBLIN) have been moved to KSEG2 based on the value of the segment type. The value is RESIDENT if QIO is moved to KSEG2. The first SCF output for \NAVAE1 shows QIO to be in FLAT_UA, which means that QIO has not been moved to KSEG2.
Z00001VHKMSF-BACKED SEGMENTS: (Process Space Guarantee = 1904KB) ----------------------------------------------------------------------------SEG-ID TYPE SIZE RESERVATION KBYTE PAGES KBYTE ----------------------------------------------------------------------------2101 8B 1 16 2100 8B 1 16 Heap+Global+SRL+Stack 330MB 21187 331MB -----------------------------------------------------------------------------TOTAL 21187 331MBFILE 331MBFILE-BACKED SEGMENTS: None ___________________________________________________
1 Click on the specific signal to obtain information about how to install signal handlers for the corresponding signals. SIGWINCH HeapDumpOnly feature uses SIGWINCH signal. Hence, the application installs signal handler for this signal, provided HeapDumpOnly option is not enabled. HeapDumpOnly option is either enabled by using XX:+HeapDumpOnly Java command line option or by setting 1 for the environment variable (_JAVA_HEAPDUMP_ONLY).
These files are no longer loaded by default. For existing deployments that rely on .hotspot_compiler (for example, to exclude a method from hotspot compilation), and .hotspotrc, an unsupported behavioral option is provided to simulate the old loading behavior. The following command line options support old behavior: —XX:Flags=.hotspotrc reverts to old behavior for .hotspotrc. —XX:CompileCommandFile=.hotspot_compiler reverts to old behavior for the .hotspot_compiler. Change in Loading of .
5 Transactions The NonStop Server for Java 6.0 lets you work with transactions in several ways. You can: • Use the Current class methods to define transactions across transaction services, such as transactions that include JDBC calls. • Use the Java Transaction API (JTA) .
Table 9 Current Class Methods (continued) Method Description rollback_only Marks the transaction associated with the calling thread so that the only possible outcome is to roll back the transaction. set_timeout Modifies the time-out value associated with transactions started by subsequent invocations of the begin method. suspend Suspends the association of the calling thread with a transaction context.
javax.transaction Interfaces The Sun Microsystems JTA package, javax.transaction, defines the following interfaces: • Status • Synchronization • Transaction • TransactionManager • UserTransaction NonStop Server for Java Transaction API supports all of the preceding interfaces, but only UserTransaction is available to client programs. UserTransaction allows the client to control transaction boundaries programmatically.
// Get a reference to UserTransaction based on TMF (by default). UserTransaction utx = JTAFactory.getUserTransaction(); // Start transaction utx.begin(); // Do work ... // Commit transaction utx.commit(); NonStop Server for Java Transaction API-TMF by Request The following code gets a reference to UserTransaction based on TMF (which it requests). It then starts and ends atransaction. import javax.transaction.UserTransaction; import com.tandem.jta.
6 Application Profiling Application profiling and monitoring are supported through HPjmeter tool, which works in combination with NSJ options, -Xeprof and -agentlib:hprof as explained in this chapter. The NonStop Server for Java 6.0 supports the profiling of live Java applications. The HPjmeter console is a GUI tool that runs on Java platforms that support GUI, such as HP-UX, Linux, and Windows.
NOTE: • For information on analyzing profile data, see the HPjmeter 4.2 User’s Guide available at www.hp.com/go/hpjmeter. • The instructions for using the HPjmeter tool on the NonStop platform are provided in “Addendum to HPjmeter 4.2 User's Guide” (page 88). —Xeprof The —Xeprof option generates profile data for HPjmeter. —Xeprof focuses primarily on performance problems that characterize large server applications.
NOTE: The following HPROF option is not supported on NSJ 6.0 : -agentlib:hprof=cpu=samples Obtaining Garbage Collection Data for Analysis Garbage collection data can be collected in either one of the following two ways: 1. Data collection with —Xverbosegc. Launch the Java application using the –Xverbosegc option. For more information on the option, see NonStop Server for Java 6.0 Tools Reference. 2. Data collection with Zero preparation.
You must use both M and N when you use the -XX:GCLogLimits=M,N option. If this option is not specified, the default behavior is to write a single GC log file with unlimited size. When rotation is in effect, a sequence number is appended to the GC filename (0 through N-1). (Examples of file names are: filename.0, filename.1, and filename.2). With log rotation, when the specified maximum number of files (N) is reached, logging cycles back to the first file in the sequence (filename.
7 Migrating Applications This appendix describes the changes required to migrate applications that use earlier versions of the NonStop Server for Java. Note the terminology: • NonStop Server for Java 4 refers to the product based on J2SE SDK 1.4.x • NonStop Server for Java 5.1 refers to the product based on J2SE JDK 5.0 • NonStop Server for Java 6.0 refers to the product based on Java SE JDK 6.0 See theTable 10 (page 80) for the topics that apply to migrating from particular versions.
Java 6.0, see “Supported and Unsupported Features of NonStop Server for Java 6.0” (page 87)and “New and Changed Information” (page 8). Installation Changes The standard location for the NonStop Server for Java 6.0 is a location of the form: /usr/tandem/nssjava/jdk160_h60 where jdk60 refers to the version number of the Sun Microsystems update upon which NonStop Server for Java 6.0 is based. The number h60 identifies the particular NonStop Server for Java 6.0 > PVU.
will not have to reinstall user-provided JAR files for new product releases of NonStop Server for Java 4. You, however, have to place the JAR files in your CLASSPATH. Dynamic Link Libraries (DLLs) On the TNS/E platform, NonStop Server for Java 4 , 5, 5.1, and 6.0 support Dynamic-Link Libraries (DLLs). All NonStop Server for Java applications migrating from TNS/R to TNS/E must convert native libraries to DLLs. Consider these issues when migrating applications to use DLLs with the NonStop Server for Java 6.
Floating-Point Support By default, NonStop Server for Java 3.1.x and earlier versions converted any floating-point value that crossed the Java Native Interface (JNI) boundary to a TNS float. This default could be overridden by supplying a line in the file TandemVMClassFP.properties. If a particular class needed IEEE floating-point values passed to its JNI code instead of TNS float values; users added a property (with the name of the class being the name of the property) to this file.
NonStop Server for Java 6.0 supports the Sun Microsystems enhancement to AWT called "headless support" that allows a JVM to indicate whether a display, keyboard, sound, or mouse operation can be supported in a graphics environment. Sun implemented headless support by supplying two new methods in the GraphicsEnvironment class: is Headless and is HeadlessInstance. In addition, Sun created a new exception java.awt.HeadlessException.
automatically. To enable parsing into BigDecimal, you need to use the setParseBigDecimal method. JAAS Enhancement In NonStop Server for Java 3.x and earlier versions, the Java Authentication and Authorization Service (JAAS) was an optional package (extension). JAAS is integrated into the NonStop Server for Java 6.0. JAAS augments the core Java 2 platform with APIs that allow authenticating users and enforcing access controls upon users.
dlfcn.h File All applications migrating from TNS/R that use the dlfcn.h file require code changes. On TNS/E the NonStop Server for Java 4 , 5, 5.1, and 6.0 do not use their own special version of dlfcn.h. Use the file that exists in the include directory (/usr/include) of the system.
A Supported and Unsupported Features of NonStop Server for Java 6.0 NonStop Server for Java 6.0 includes all the features of NonStop Server for Java 5.1 and it is based on Java SE 6.0. For information about Java SE 6.0 new features, see New Features and Enhancements Java SE 6.0 (http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html). Java SE 6.0 Features not Implemented in NonStop Server for Java 6.0 Java SE 6.
B Addendum to HPjmeter 4.2 User's Guide This appendix provides instructions for using the HPjmeter tool on NonStop system. It is based on the HP-UX HPjmeter 4.2 User's Guide, available at the following web address: www.hp.com/go/ hpjmeter/. The following sections correspond one-to-one to those in the HP-UX HPjmeter 4.2 User's Guide.
Configuring your Application to Use HPjmeter Command Line Options Preparing to run Java Complete the following steps to prepare the Java application to run with the JVM agent: • On NSJ6 and later SPRs, you must set the _RLD_LIB_PATH as follows: $JMETER_HOME/lib/oss where, JMETER_HOME is set to /usr/tandem/hpjmeter.
Collecting Profile Data Profiling with —Xeprof Table 13 Supported –Xeprof options time_on On NonStop operating systems, the time interval between the start and stop signals must be more than 5 minutes. time_slice This is because the Java thread switching process is slow due to the non-preemptive nature of the NonStop operating system. As a result, the asynchronous signals might be lost if they are posted to the NonStop OS Java process at very short intervals.
Quick References Determining which HPjmeter Features are Available with a Specific JVM Version For HPjmeter features available in JVM version see, “Table A-2 HPjmeter Features Available by JVM Version” in HPjmeter 4.2 User's Guide. NOTE: • HPjmeter features are supported on NSJ 6.0 and later releases. • All instances of PROF must be read as ALRM. • All instances of signal 21 must be read as 14.
Glossary A abstract class In Java, a class designed only as a parent from which subclasses can be derived, which is not itself suitable for instantiation. An abstract class is often used to "abstract out" incomplete sets of features, which can then be shared by a group of sibling subclasses that add different variations of the missing pieces. Abstract Window Toolkit (AWT) The package that implements graphical user interfaces for Java.
command The operation demanded by an operator or program; a demand for action by, or information from, a subsystem. A command is typically conveyed as an interprocess message from a program to a subsystem. Common Gateway Interface (CGI) The World Wide Web standard interface for servers , often written in C . The NonStop Server for Java 6.0 supports CGI-like use of Java using servlets with iTP Secure WebServer . See also Pathway CGI.
fails. Files on a NonStop system can be Enscribe files, SQL/MP tables, or SQL/MX tables. Enscribe files can be either structured or unstructured. exception An event during program execution that prevents the program from continuing normally; generally, an error. Java methods raise exceptions using the throw keyword and handle exceptions using try, catch, and finally blocks.
HP NonStop Transaction Management Facility (TMF) An HP product that provides transaction protection, database consistency, and database recovery. SQL statements issued through a JDBC driver against a NonStop SQL database call procedures in the TMF subsystem. HP NonStop TS/MP (TS/MP) An HP product that supports the creation of Pathway servers to access NonStop SQL/MP or Enscribe databases in an online transaction processing (OLTP) environment.
2. operating systems from the same vendor. HP documents often use the term connectivity in this context, while other vendors use connectivity to mean hardware compatibility. Within a NonStop system node , the ability to use the features or facilities of one environment from another. For example, the gtacl command in the OSS environment allows an interactive user to start and use a Guardian tool in the Guardian environment.
application server, and the transactional applications. For more information, see the Sun Microsystems JTA document (http://java.sun.com/products/jta/index.html). Java Transaction Service (JTS) The transaction API , modeled on OMG's OTS . The NonStop Server for Java 6.0 includes an implementation of the jts.Current interface . Java virtual machine (JVM) The process that loads, links, verifies, and interprets Java bytecode . The NonStop Server for Java 6.
2. a table with records being rows). Alternatively, the key can be obtained by applying a function to one or more of the fields. A value that must be fed into the algorithm used to decode an encrypted message in order to reproduce the original plain text. Some encryption schemes use the same (secret) key to encrypt and decrypt a message, but public key encryption uses a private (secret) key and a public key that is known by all parties. LAN See local area network (LAN).
processed while the requester waits, as opposed to queued or batched transactions, which are processed at a later time. Online transaction processing can be used for many different kinds of business tasks, such as order processing, inventory control, accounting functions, and banking operations. Open Database Connectivity (ODBC) The standard Microsoft product for accessing databases.
R RDF See Remote Duplicate Database Facility (RDF). Remote Duplicate Database Facility (RDF) The HP software product that does the following: Remote Method Invocation (RMI) The Java package used for homogeneous distributed objects in an all-Java environment. requester See client. RMI See Remote Method Invocation (RMI). rmic The Java RMI stub compiler, which generates stubs and skeletons for remote objects.
Standard Extension API An API outside the Core Packages for which Sun Microsystems, Inc. has defined and published an API standard. Some of the Standard Extensions might migrate into the Core Packages. Examples of standard extensions are servlets and JTS . stored procedure A procedure registered with NonStop SQL/MX and invoked by NonStop SQL/MX during execution of a CALL statement.
uniform resource locator (URL) A draft standard for specifying an object on a network (such as a file, a newsgroup, or, with JDBC, a database). URLs are used extensively on the World Wide Web . HTML documents use them to specify the targets of hyperlinks . URL See uniform resource locator (URL). virtual machine (VM) A self-contained operating environment that behaves as if it is a separate computer. See also Java virtual machine and Java Hotspot virtual machine . VM See virtual machine (VM).