Two-phase commit environment recommendations

To run a two-phase commit application, review the following recommendations to avoid a region or message processing from stopping due to contention for resources.

  • Have as many message processing program (MPP) regions as possible running to ensure that two-phase commit applications do not contend for a region, because a transaction that is within a two-phase commit application uses an MPP region for the duration of the entire two-phase commit transaction.
  • If a number of IMS™ transactions are performed within a two-phase commit transaction, at least that many MPP regions must be available to avoid stopping the two-phase commit application.
  • To safeguard against a transaction that might be waiting for an extensive amount of time for resources, set an appropriate timeout value for each interaction taking place within the global transaction.
  • Avoid having an excessive number of database interactions performed in one two-phase commit transaction. If multiple IMS transactions are used within a two-phase commit transaction, they could contend or lock in an attempt to update or modify the same data. To avoid this problem, write an application that will prevent a user from accessing duplicate entries within the same two-phase commit operation.
  • Consider configuring your internal resource lock manager (IRLM) or Program Isolation (PI) locking manager to use a block size that is as small as the smallest entry to that database. Larger block sizes might have two transactions contending for entries that might not even be the same and yet reside close to one another on the disk.
  • If multiple interactions are performed using the same IMS transaction on the same IMS database within a global transaction (unit-of-work), each interaction with that IMS transaction must run on a separate MPP region. The IMS transaction must have a SCHDTYP=PARALLEL and a PARLIM=0 value, to indicate that the IMS transaction can run on multiple MPP regions and that it will always meet the scheduling requirements (the number of messages will be greater than zero) to process every interaction on a new MPP region.
  • If a region is hung, and no execution timeout value has been set, you can end the attempt to run a transaction that is hanging the MPP region by issuing a /STOP REGION IMS command with the abend transaction parameter. For example, /STOP REGION reg# ABDUMP tranname. This command rolls back the transaction for that particular interaction and free the MPP region.