Db2 data sharing

Db2® data sharing enables CICS transactions that are running in any CICS® application-owning region to access the same shared Db2 data.

The DB2CONN definition contains the name of the Db2 subsystem or the group name of the Db2 data sharing group to which CICS connects. Using the group name, rather than a specific subsystem name, enables a CICS region on any system in the sysplex to connect to any Db2 running in the same LPAR in the data sharing group. This exploits Db2 structures that are defined in the z/OS® coupling facility. A Db2 data sharing group consists of several Db2 data managers that can all access the same tables. The data managers can run in the same or in separate z/OS logical partitions. This way of running allows the various regions of a CICSPlex to share data in the same Db2 tables.

A data sharing group offers an availability advantage as other data managers in the group can provide continued access to data should a data manager in the group fail.

A facility referred to as Db2 group attach can provide additional availability benefits:
  • Without Db2 group attach, each CICS region is configured to use a specified Db2 data manager.
  • With Db2 group attach, each CICS region is configured to use any data manager in the data sharing group - although you need to consider Db2 INDOUBT resolution.
Db2 data sharing group support enables you to configure a CICSPlex in various ways:
  • One data manager in each logical partition, without CICS Db2 group attach.

    All CICS regions in a partition connect to their specified Db2 data manager. That Db2 manager must be running in the same logical partition.

  • One data manager in each logical partition, with CICS Db2 group attach.

    All CICS regions in a partition connect to whatever Db2 data manager is running in the same logical partition. This configuration is similar to the previous configuration except that a CICS region in one partition can fail and then restart in any partition where there is a data manager in the same data sharing group. It can use any data manager in the data sharing group to access the Db2 data.

  • More than one data manager in each logical partition, with CICS Db2 group attach.
    Each CICS region in a partition connects any one of the Db2 data managers that are running in the same logical partition. This configuration is similar to the previous configuration except in the following situations:
    • When a CICS region in one partition fails and then restarts in the same region, it might connect to a different Db2 data manager. This step can delay resolution of in-doubt units of recovery.
    • When a Db2 data manager in one partition fails, CICS regions in that partition can connect to another data manager in the same partition and continue to access the Db2 data.

If CICS loses its connection to the Db2 that it is connected to, and it has INDOUBT units of work in progress with that Db2, it attempts to reconnect to that Db2. However, even if it is not successful in its initial reconnection attempt, it remembers that it has an outstanding unit of work with that Db2. If the CICS region is later restarted (or if the Db2 connection is stopped and restarted) and that Db2 is available, CICS automatically reconnects to it (provided CICS is on the same z/OS system as the Db2 subsystem), even if there are multiple Db2 subsystems from the same data sharing group on that system.

How CICS reacts to the initial loss of connection to Db2 is controlled by the RESYNCMEMBER and STANDBYMODE keywords on the DB2CONN definition. CICS always makes one attempt to reconnect. However, if that fails, CICS either waits for that Db2 to become active again, or it attempts to connect to another member of the data sharing group, if one exists on the same z/OS system as CICS.

If you have multiple Db2 subsystems in the same data sharing group on the same z/OS system, consider setting the RESYNCMEMBER keyword to NO. This means that the CICS region connects to another Db2 and is able to continue processing Db2 transactions. The INDOUBT units of work remain outstanding and are not resolved until CICS reconnects to the original Db2. However, you can drain the CICS region at a convenient time, then stop and restart the Db2 connection, and the INDOUBT units of work are resolved at that point.

To stop the flow of Db2 transactions to this region during the time after it initially loses its connection to Db2, use the CICSPlex® SM ABENDTHRESH and ABENDCRIT function as described in CICSPlex SM transaction abend thresholds.

For more information about how CICS connects to Db2, see Overview: How CICS connects to Db2. For more information, see Using the Db2 group attach facility.