Overview: How CICS connects to DB2

A CICS® DB2® attachment facility is provided with CICS. The CICS DB2 attachment facility provides CICS applications with access to DB2 data while operating in the CICS environment. CICS applications, therefore, can access both DB2 data and CICS data. CICS coordinates recovery of both DB2 and CICS data if transaction or system failure occurs.

The CICS DB2 attachment facility creates an overall connection between CICS and DB2. CICS applications use this connection to issue commands and requests to DB2. The connection between CICS and DB2 can be created or terminated at any time, and CICS and DB2 can be started and stopped independently. You can name an individual DB2 subsystem to which CICS connects, or (if you have DB2 Version 7 or later) you can use the group attach facility to let DB2 choose any active member of a data-sharing group of DB2 subsystems for the connection. You also have the option of CICS automatically connecting and reconnecting to DB2. A DB2 system can be shared by several CICS systems, but each CICS system can be connected to only one DB2 subsystem at a time.

Attachment commands display and control the status of the CICS DB2 attachment facility, and are issued using the CICS supplied transaction DSNC. The attachment commands are:

The connection between CICS and DB2 is a multithread connection. Within the overall connection between CICS and DB2, there is a thread--an individual connection into DB2--for each active CICS transaction accessing DB2. Threads allow each CICS transaction to access DB2 resources, such as a command processor or an application plan (the information that tells DB2 what the application program's SQL requests are, and the most efficient way to service them). See Overview: How threads work below for a full explanation of how threads work.

When an application program operating in the CICS environment issues its first SQL request, CICS and DB2 process the request as follows:

The DB2 address spaces

DB2 requires several different address spaces. Figure 1 shows these address spaces.

Figure 1. The DB2 address spaces
 The CICS address space has connections to the DB2 subsystem. The  DB2 subsystem contains the following address spaces: DSN1MSTR, DSN1DBM1, DSN1DIST, IRLMPROC, and DSN1SPAS.

Various tasks are performed in the different address spaces, as follows:

DSN1MSTR
for system services that perform a variety of system-related functions.
DSN1DBM1
for database services that manipulate most of the structures in user-created databases.
DSN1DIST
for distributed data facilities that provide support for remote requests.
IRLMPROC
for the internal resource lock manager (IRLM), which controls DB2 locking.
DSN1SPAS
for stored procedures, which provide an isolated execution environment for user-written SQL.

Related concepts
Overview of the CICS DB2 interface
Overview: How threads work
Overview: How you can define the CICS DB2 connection
Overview: Enabling CICS application programs to access DB2
[[ Contents Previous Page | Next Page Index ]]