To run a two-phase commit application, consider the following suggestions:
- It is best to have as many 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 hanging
the two-phase commit application.
- To safeguard against a transaction that may be waiting for an extensive
amount of time for resources, it is recommended to 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 possibly contend or lock in an attempt to update
or modify the same data. To avoid this, it's best to write an application
that will prevent a user from accessing duplicate entries within the same
two-phase commit operation.
- Consider configuring your IRLM or 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 may not even be the
same and yet reside close to one another on the hard 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, waiting for RRS-OTMA and no execution timeout value
has been set, you can end the attempt to run a transaction that is hanging
the MPP region. This can be done by issuing a stop region IMS command with
the abend transaction parameter. For example, /STOP REGION reg#ABDUMP tranname.
This will rollback the transaction for that particular interaction and free
the MPP region.