As well as the DB2CONN, DB2ENTRY, and DB2TRAN objects you define, the CICS® DB2® connection is affected by a system initialization parameter, MAXOPENTCBS. MAXOPENTCBS controls the total number of L8 mode TCBs that the CICS region can have in operation at any time, so it is relevant when CICS is connected to DB2 Version 6 or later (when open TCBs are used to run threads into DB2). L8 mode open TCBs are reserved for use by task-related user exits that are enabled with the OPENAPI option. These include the CICS DB2 task-related user exit, when CICS is connected to DB2 Version 6 or later.
In the open transaction environment (when CICS is connected to DB2 Version 6 or later), the TCBLIMIT attribute of the DB2CONN definition controls how many of the L8 mode open TCBs can be used by the CICS DB2 task-related user exit to run threads into DB2. If the TCBLIMIT is reached, the CICS DB2 task-related user exit can obtain an open TCB from the pool controlled by MAXOPENTCBS, but it must wait before it can use the open TCB to run a thread into DB2. When another task stops using its open TCB to run a thread into DB2, and so the number of open TCBs in use running threads falls below TCBLIMIT, the waiting task is allowed to use its own open TCB to run a thread into DB2. However, if MAXOPENTCBS is reached, no more open TCBs are allowed in the CICS region, and the CICS DB2 task-related user exit cannot even obtain an open TCB for its use. It must wait until an open TCB is released by another task and returned to the pool controlled by MAXOPENTCBS, when it can use the released open TCB. For more information about how L8 mode TCBs are managed, and the effects of a shortage of open TCBs, see the CICS Performance Guide.
To ensure that you have enough open TCBs available to meet your DB2 workload, set the limit in your MAXOPENTCBS system initialization parameter to a value greater than the limit set in the TCBLIMIT attribute of your DB2CONN definition. If MAXOPENTCBS is lower than TCBLIMIT, the system may run out of open TCBs before it reaches TCBLIMIT. When CICS connects to DB2, a warning message, DFHDB2211, is issued if the CICS DB2 attachment facility detects that CICS is connecting to DB2 Version 6 or higher, and that the setting of MAXOPENTCBS in the SIT is lower than the TCBLIMIT setting in the DB2CONN definition. If you receive this warning message, adjust your MAXOPENTCBS limit.
In addition, when running with Transaction Isolation active and connected to DB2 Version 6 or later, set MAXOPENTCBS to the value of max tasks (MXT) or higher. This will minimise the possibility of TCB stealing due to a TCB being allocated to the wrong subspace. The CICS Performance Guide explains how this happens.
When CICS is connected to DB2 Version 5 or earlier, and is not exploiting the open transaction environment, the CICS DB2 task-related user exit uses its own specially created subtask thread TCBs to run threads, rather than using open TCBs. In this environment, the TCBLIMIT attribute of the DB2CONN definition simply controls how many subtask thread TCBs the CICS DB2 attachment facility can create. MAXOPENTCBS is not relevant when CICS is connected to DB2 Version 5 or earlier, as it only applies to open TCBs. If TCBLIMIT is reached in this environment, the CICS DB2 task-related user exit must wait until another task stops using a subtask thread TCB, and it can then use the released subtask thread TCB.