Design overview

The CICS®-DB2® Attachment facility allows connection to a DB2 subsystem using the CICS resource manager interface (RMI), which is also known as the task related user exit interface. The Attachment facility interfaces to DB2 through a series of requests to three components of DB2, each of which processes specific types of requests:

There no are DB2 release dependencies within the attachment facility, it can connect to a DB2 subsystem running any supported level of DB2.

The architecture of the CICS-DB2 interface is described in CICS DB2 Guide:

CICS Initialization

During CICS Initialization the following modules are invoked:

CICS-DB2 initialization gate DFHD2IN1

DFHD2IN1 first receives control from DFHSII1 duiring CICS initialization by means of a DFHROINM INITIALISE call. When invoked with this function DFHD2IN1 attaches a system task CSSY to run program DFHD2IN2.

DFHD2IN1 is invoked a second time later by DFHSII1 by means of a DFHROINM WAIT_FOR_INITIALIZATION call for which DFHD2IN1 issues a CICS wait to wait for DFHD2IN2 processing to complete.

CICS-DB2 recovery task DFHD2IN2

DFHD2IN2 runs under CICS system task CSSY attached by DFHD2IN1. DFHD2IN2 links to program DFHD2RP, the CICS-DB2 restart program. On return from DFHD2RP, DFHD2IN2 posts the ecb waited on by DFHD2IN1 so that CICS Initialization can continue.

CICS-DB2 restart program DFHD2RP

DFHD2RP runs under system task CSSY during CICS initialization. DFHD2RP performs the following functions:

CICS-DB2 Attachment startup

The CICS-DB2 Attachment facility can be started using one of the following methods:

All of the above ways result in an EXEC CICS SET DB2CONN CONNECTED command being issued and the CICS-DB2 startup program DFHD2STR getting control.

CICS-DB2 startup program DFHD2STR

The startup program starts by reading a temporary storage queue to obtain any parameters passed if a DSNC STRT command has been issued. It also retrieves any parameters specified via the INITPARM SIT parameter by linking to program DFHD2INI.

Next DFHD2STR must ensure the necessary DFHD2GLB block is installed. If a DFHD2GLB is already installed, representing an installed DB2CONN, then it is checked to make sure interface is currently shut before startup can proceed.

The remainder of DFHD2STR processing is as follows:

CICS-DB2 attachment shutdown

The CICS-DB2 Attachment facility can be stopped using one of the following methods:

All of the above ways result in an EXEC CICS SET DB2CONN NOTCONNECTED command being issued and the CICS-DB2 shutdown program DFHD2STP getting control.

CICS-DB2 shutdown program DFHD2STP

Processing in DFHD2STP is as follows:

CICS-DB2 mainline processing

CICS-DB2 task related user exit (TRUE) DFHD2EX1

Control is passed to the TRUE via the CICS RMI. The TRUE manages the relationship between a CICS task (represented by a LOT control block), and a CICS-DB2 thread (represented by a CSB control block). DFHD2EX1 uses parameters set in the DB2CONN and DB2ENTRY definitions to manage use of the CICS DB2 threads, each thread running under a thread TCB.

The CICS-DB2 TRUE DFHD2EX1 gets invoked by the RMI for the following events:

CICS-DB2 coordinator program DFHD2CO

The coordinator program runs under the CICS Resource owning (RO) TCB, and handles the overall connection between CICS and a DB2 subsystem. It is called :

CICS-DB2 master subtask program DFHD2MSB

When operating with DB2 for OS/390 Version 5 or earlier, the DFHD2MSB TCB is attached by DFHD2STR during startup of the Attachment facility. It runs as a 'daughter' of the main CICS TCB. It is 'mother' to all the subtask TCBs which process the DB2 work. The DFHD2MSB TCB is detached by DFHD2STP during CICS-DB2 Attachment shutdown.

The main functions of DFHD2MSB are:

CICS-DB2 subtask program DFHD2EX3

When operating with DB2 for OS/390 Version 5 or earlier, a CICS-DB2 subtask TCB is attached by DFHD2MSB when required by DFHD2EX1. It runs as a daughter of the DFHD2MSB TCB and a granddaughter of the main CICS TCB. A CICS-DB2 subtask TCB normally remains active for the lifetime of the CICS Attachment facility and terminates as part of CICS-DB2 Attachment facility shutdown. Exception conditions that cause a subtask TCB to be detached are:

The DFHD2EX3 program issues requests to DB2 using the DB2 SSSC, ADMF and IFC interfaces communicating via the DB2 program request handler DSNAPRH. In order to process DB2 requests a TCB first has to IDENTIFY to DB2, secondly it has to SIGNON to DB2 to establish authorization ids to DB2. Thirdly a thread has to be created. Once a thread has been created API and syncpoint requests can flow to DB2. Subsequent SIGNON requests can occur for a thread to change authorization ids to DB2 or for the purposes of DB2 cutting accounting records (partial SIGNON) When a thread is nolonger required it is terminated. The TCB remains identified and signed on to DB2 and awaits another request requiring it to create a thread again.

Each DB2 subtask runs an instance of program DFHD2EX3 and each is represented by a DFHD2CSB control block. A CSB control block is anchored to one of three CSB chains depending on its state (an active thread within a UOW, a thread waiting for work, or an identified, signed on TCB with no thread). The CICS-DB2 TRUE DFHD2EX1 manages the CSB chains.

CICS-DB2 thread processor DFHD2D2

The thread processor program DFHD2D2 is used only when operating with DB2 for OS/390 Version 6 and above, when the CICS-DB2 Attachment Facility uses CICS open TCBs (L8 TCBs) rather than privately managed subtask TCBs. In the Open Transaction environment (OTE), the CICS-DB2 TRUE DFHD2EX1 is invoked under an L8 TCB. Instead of posting a subtask, DFHD2EX1 calls DFHD2D2 under the L8 TCB. DFHD2D2 performs the same functions as performed by subtask program DFHD2EX3 in a non OTE environment, that is issuing the identify, signon, create thread, terminate thread calls to DB2, plus the api and syncpoint calls to DB2.

DFHD2D2 is called via a subroutine domain call on which the address of the relevant connection control block (DFHD2CSB) is passed. On the first call of a unit of work, DB2 is called to "associate" the connection with the calling L8 TCB. Once this is done, calls to DB2 can proceed as normal. When a DB2 thread is released from a CICS transaction (typically at syncpoint), the connection is "dissociated" from the L8 TCB. Hence a connection control block (DFHD2CSB) has an affinity to an L8 TCB whilst is associated. With DB2 for OS/390 Version 5 and below a connection has a permanent affinity to its subtask TCB.

CICS-DB2 service task program DFHD2EX2

The CICS-DB2 service task program DFHD2EX2 runs as a CICS system task under transaction CEX2. Its mains functions are:

CICS-DB2 PLTPI program DFHD2CM0

Used in PLTPI or as a result of DB2CONN=YES being set in the SIT. It issues an EXEC CICS SET DB2CONN CONNECTED command to start up the CICS DB2 Attachment facility.

CICS-DB2 comand processor DFHD2CM1

DFHD2CM1 processes commands issues via the DSNC command. The following commands are processed:

CICS-DB2 shutdown quiesce program DFHD2CM2

Runs under transaction CDBQ. Issues an EXEC CICS SET DB2CONN NOTCONNECTED WAIT command to shutdown the CICS-DB2 Attachment facility.

CICS-DB2 shutdown force program DFHD2CM3

Runs under transaction CDBF. Issues an EXEC CICS SET DB2CONN NOTCONNECTED FORCE command to shutdown the CICS-DB2 Attachment facility.

CICS-DB2 table manager DFHD2TM

Handles installs, discards, inquire and set requests for the DFHD2GLB, DFHD2ENT and DFHD2TRN control blocks representing the DB2CONN, DB2ENTRY and DB2TRAN resources. Callers of DFHD2TM are:

CICS DB2 statistics program DFHD2ST

Called by AP domain statistics program DFHAPST to process CICS-DB2 statistics for EXEC CICS COLLECT STATISTICS and EXEC CICS PERFORM STATISTICS commands.

CICS DB2 connection control program DFHD2CC

DFHD2CC proceses the following requests:

CICS DB2 EDF processor DFHD2EDF

Receives control from CICS-DB2 TRUE DFHD2EX1 when the TRUE is invoked for an EDF request. DFHD2EDF uses the RMI provided parameters to format the screen to be output by EDF before and after an EXEC SQL request is issued.

[[ Contents Previous Page | Next Page Index ]]