Thread TCBs (task control blocks)

In the CICS® Db2® environment, each thread into Db2 runs under a thread task control block (TCB). This section provides further technical information about thread TCBs, to assist with problem determination.

See Overview: How threads work for an overview of thread TCBs.

Thread TCBs are open L8 mode TCBs. The open TCBs are “daughters” of the main CICS TCB (the QR TCB). The CICS Db2 task-related user exit itself runs on the open TCB, as well as using it to run the thread. The task-related user exit uses the CICS Db2 attach module DFHD2D2 to invoke Db2 when it needs to acquire a thread. Another module, DFHD2CO, running on a different TCB, deals with aspects of the overall CICS Db2 connection, including identifying to Db2 and disconnecting CICS from Db2.

The maximum number of open TCBs that can be running threads into Db2 at any one time is controlled using the TCBLIMIT parameter of the DB2CONN. An open TCB running a thread is not terminated when the thread is terminated. An open TCB can be terminated if:
  • A CICS transaction is force purged from CICS and the thread is still active in Db2. In this case the TCB is terminated as a means of flushing the request out of Db2. The current UOW in Db2 is backed out.
  • CICS is in doubt as to the outcome of a UOW because it has lost contact with its coordinator. Terminating the TCB causes Db2 to release the thread, but maintain the UOW as indoubt and maintain its locks. The UOW is completed by a later resynchronization when CICS reestablishes contact with its coordinator.
  • The CICS dispatcher, where open TCBs are returned if they are not being used by the CICS Db2 attachment facility, cleans up the unused open TCBs after 30 minutes.