How JVMs are reused

Every Java program that is run in CICS, runs in a JVM that has been assigned to run that program alone. This ensures that every transaction involving a JVM is isolated from every other concurrent transaction involving a JVM. However, when a Java program has finished using its JVM, the JVM can be reassigned to another, subsequent program and reused for that program.

The JVM provided by the IBM® Software Developer Kit for z/OS®, Java™ 2 Technology Edition, Version 1.4.2, which features the persistent reusable JVM technology, can be reused many times by Java applications in CICS®, either by a different Java program in the same transaction, or by another transaction. This model is suited to CICS transaction processing, which is characterized by short, repetitive transactions, usually processed in high volumes. The earlier JVM supported by CICS in CICS TS 1.3, which was provided by the IBM Developer Kit for the Java Platform 1.1.8, was a single-use JVM, which had to be initialized afresh for every application. This model typically had high startup overheads. JVM reuse is the preferred method for running all Java applications in CICS, and provides the only way to run Java applications comprising enterprise beans or which are started by IIOP requests.

CICS provides three levels of reusability for JVMs, which you can select depending on the needs of your applications. The level of reusability for a JVM is controlled by the REUSE option in the JVM profile for the JVM. The characteristics of the three levels of reusability can be summarized as follows:

Table 1. Reuse and reset characteristics of JVM types
JVM type (and action between JVM uses) REUSE option in profile Compatible with the shared class cache? Are program invocations allowed to pass state to subsequent invocations? Are programs allowed to change characteristics of the JVM? Performance
Continuous (JVM reused without reset) REUSE= YES Yes1 Yes Yes Highest (JVM not initialized or reset for each use)
Resettable (JVM reused and reset) REUSE= RESET Yes1 No (JVM storage cleaned up after each use) No (JVM destroyed if this occurs) Medium (JVM reset, but not initialized for each use)
Single-use (JVM destroyed) REUSE= NO No No (JVM destroyed) Yes Lowest (JVM initialized for each use)
Note:
  1. The worker JVMs in a CICS region all have the same level of reusability as the master JVM in that region, so you cannot mix resettable worker JVMs and continuous worker JVMs in a CICS region.

The following sections discuss each of these types of JVM in more detail: