Working with XA transactions

Using the IBM® IoT MessageSight resource adapter, WebSphere® Application Server can act as an external transaction manager and IBM IoT MessageSight can act as a resource manager in a distributed transaction processing (DTP) environment to process XA transactions.

In a DTP environment, messaging operations are performed in XA transactions that are coordinated by a transaction manager. The transaction manager coordinates the two-phase commit process. It is responsible for committing or rolling back the XA transactions. The transaction manager puts transactions into prepared state during the first phase of the two-phase commit process and they remain in this state until they are committed or rolled back by the transaction manager.

Within each resource manager that is performing work for an XA transaction in a DTP environment, the XA transaction is represented by an XA transaction branch. The transaction branch is the unit for which each resource manager and transaction engage in the coordination of the two-phase commit process. When all transaction branches for a transaction are in the appropriate state, the transaction can be committed or rolled back.

It is possible, in rare situations such as long-lasting loss of connectivity between IBM IoT MessageSight and the transaction manager, for an XA transaction branch in IBM IoT MessageSight to remain in the prepared state. It then becomes necessary to commit or roll back such a transaction branch independently of the transaction manager.

It is also possible for transaction branches to remain in a heuristically complete state. The commit or rollback decision might have been delivered independently of the transaction manager and, in the continuing absence of the transaction manager due to a long-lasting loss of connectivity, such transaction branches remain in this state. It is then necessary to forget these transaction branches.

You can apply a heuristic commit, rollback, or forget decision to a transaction branch by using the IBM IoT MessageSight Web UI or REST Administration APIs.

Implement the heuristic decisions that you make only when you are certain that the transaction cannot be resolved by the normal protocols. Implementation might result in the loss of transactional integrity between IBM IoT MessageSight and other resource managers.