Execution key (EXECKEY attribute)

A Java program needs to run in a JVM that is in the correct execution key. JVMs can be in one of two execution keys: user key or CICS key. Running applications in user key extends CICS storage protection, so most of your Java programs should run in a JVM in user key. However, if a Java program is part of a transaction that specifies TASKDATAKEY(CICS), the program needs to run in a JVM in CICS key.

When you set the EXECKEY parameter on the PROGRAM resource definition for a Java program to USER, CICS gives the program a JVM that is in user key. A J9 TCB is used to run the JVM, and MVS storage is obtained in user key. When you set the EXECKEY parameter to CICS, CICS gives the program a JVM that is in CICS key. A J8 TCB is used to run the JVM, and MVS storage is obtained in CICS key. (How CICS manages JVMs in the JVM pool explains how JVMs and TCBs are related.)

The default for the EXECKEY parameter is USER. Before CICS® Transaction Server for z/OS®, Version 2 Release 3, the EXECKEY parameter was ignored for Java programs. CICS always made them run in JVMs in CICS key, because user key was not available for JVMs. You might find that in most cases, the PROGRAM resource definitions for Java programs that you created for earlier releases of CICS are still set to the default of EXECKEY(USER). For CORBA stateless objects and enterprise beans, CIRP (the default transaction for REQUESTMODEL definitions) specifies TASKDATAKEY(USER), and the PROGRAM resource definition for DFJIIRP (the default request processor program) specifies EXECKEY(USER), so by default CORBA stateless objects and enterprise beans run in user key.

You do not need to make any other changes if you change the EXECKEY parameter for a Java program. CICS can use the same JVM profile to create JVMs in both execution keys. A single CICS task can include Java programs running in CICS key, and Java programs running in user key. However, bear in mind that a JVM can only be reused by programs that specify the same execution key and JVM profile on their PROGRAM resource definition. If most of your JVMs are created in the same execution key, CICS has more opportunities for giving a program an existing JVM to reuse, rather than creating a new JVM. How CICS allocates JVMs to applications explains why reusing existing JVMs is more economical.