Designing the relationship between CICS applications and Db2 plans and packages

When CICS® applications use Db2® data, the application architecture must take account of design aspects related to the CICS Db2 attachment facility. One of the most important aspects to consider is the relationship between transaction IDs, Db2 plans and packages, and program modules.

If any of the program modules uses SQL calls, a corresponding Db2 plan or package must be available. The plan to be used for a transaction ID is specified in the DB2CONN or DB2ENTRY definition for the thread that the transaction uses to access Db2. The plan can be named explicitly, or a plan exit routine can be named that selects the plan name. The plan must include the DBRMs from all modules that could possibly run under this transaction ID. The DBRMs can be bound directly into the plan, or they can be bound as packages and named in a package list in the plan.

To control the characteristics of the plan and the CICS Db2 attachment facility threads, the relationship between transaction IDs, Db2 plans, and the program modules must be defined in the design step. Some of the characteristics of the threads, environmental description manager (EDM) pool, and plans that depend on the design are listed below:
  • Plan sizes
  • Number of different plans concurrently in use
  • Number of threads concurrently in use
  • Possibility of reusing a thread
  • Size of the EDM pool
  • I/O activity in the EDM pool
  • Overall page rate in the system
  • Authorization granularity
  • Use of Db2 packages

There are various design techniques for combining CICS transactions with Db2 plans, the recommended technique is to use plans based on packages.