Thread TCBs in the open transaction environment

When CICS is connected to DB2 Version 7 or later, or JDBC 2.0 or later, it uses the open transaction environment. In this environment, the CICS DB2 attachment facility uses open TCBs (L8 mode) as the thread TCBs, rather than using specially created subtask TCBs. Open TCBs perform other tasks besides accessing DB2 resources. In the open transaction environment, the CICS DB2 task-related user exit runs on an open TCB rather than on the CICS main TCB. If the application program that made the DB2 request is threadsafe, it can also run on the open TCB. (See Enabling CICS DB2 applications to use OTE through threadsafe programming for more information on application programs in the open transaction environment.)

Open TCBs are not permanently associated with a CSUB and DB2 connection control block. The CICS DB2 attachment facility can associate them with any CSUB and DB2 connection control block that are available, and therefore with any thread that is available. When the open TCB no longer needs the connection to DB2, it dissociates from, or releases, the thread, CSUB and DB2 connection control block. The thread, CSUB and DB2 connection control block can then be used by a different open TCB for the tasks it wants to perform in DB2.

If the thread is terminated before it is reused, the CSUB and DB2 connection control block remain available in the system. If no existing threads are available, and an open TCB needs a connection to DB2, the CICS DB2 attachment facility can associate the unused CSUB and DB2 connection control block with the open TCB, and reuse them to run a new thread into DB2.

Figure 1 summarizes how thread TCBs operate in the open transaction environment.
Figure 1. Thread TCBs in the open transaction environment
The content of this figure is explained by the text that follows it.
In Figure 1, situation 1 shows CICS using a thread to access DB2 in the open transaction environment. The CICS DB2 task-related user exit has been invoked by the Resource Manager Interface (RMI), and it is operating on an open TCB. The CICS DB2 attachment facility has associated a CSUB and a DB2 connection control block with the open TCB. The DB2 connection control block has a thread into DB2. The plan associated with the thread is held in DB2.

Situation 2 shows a thread that is not currently in use, but is protected. The CSUB and DB2 connection control block are still linked to each other and have a thread, but no open TCB is attached to them. The thread is available for reuse.

Situation 3 shows an assembly that remains after a thread was terminated. The CSUB and DB2 connection control block are available for reuse. They need a new thread.

Situation 4 shows open TCBs that are available for reuse. The CICS DB2 attachment facility can use these open TCBs and associate CSUB and DB2 connection control block assemblies with them to run threads into DB2.



dfhtkc0012.html | Timestamp icon Last updated: Sunday, 4 June 2017