Resolve indoubt transactions
Use this task to resolve indoubt transactions and the messages associated with them.
Transactions might become stuck in the indoubt state indefinitely because of an exceptional circumstance such as the removal of a node causing messaging engines to be destroyed. When a transaction becomes indoubt, it must be committed or rolled back so that normal processing by the affected messaging engine can continue.
We can use the administrative console to display the messages causing the problem (see Listing messages on a message point). If there are messages involved in an indoubt transaction, the identity of the transaction is shown in a panel associated with the message. We can then resolve the transaction in two ways:
- Use the server transaction management panels
- Use methods on the messaging engine MBean
We must first attempt to resolve the indoubt transaction using the application server transaction management MBean interfaces. These are documented in Manage active and prepared transactions by . Use the scripts for all application servers that might have been coordinating transactions, including Messaging actions, for the default messaging provider. If the transaction identity is known by the transaction manager scripts, use those scripts to resolve the transactions. This will consistently resolve all resources (including Messaging) within a global transaction.
If the transaction identity is not known to the transaction manager scripts that run on any application server, or if the application server hosting the transaction manager cannot be recovered, it is possible to use methods on the SIBMessagingEngine MBean to resolve the Messaging part of a transaction independently from the global transaction. The choice to commit or rollback the transaction must be made manually.
The following methods on the messaging engine MBean can be used to get a list of transaction identities (xid) and to commit and roll back transactions:
- getPreparedTransactions()
- commitPreparedTransaction(String xid)
- rollbackPreparedTransaction(String xid)
To invoke the methods, we can use a wsadmin command, for example, we can use a command of the following form to obtain a list of the indoubt transaction identities from a messaging engine MBean:
wsadmin>AdminControl.invoke(AdminControl.queryNames("type=SIBMessagingEngine,*"). splitlines()[0] , "getPreparedTransactions")Note: The wsadmin scripting client is run from Qshell. For more information, see Configure Qshell to run WebSphere scripts . Alternatively, we can use a script such as the following to invoke the methods on the MBean:
import sys mebeans=AdminControl.queryNames("type=SIBMessagingEngine,*").splitlines() for mebean in mebeans: input=0 meName="" print "--- Start ME: ---------------" print mebean print "-----------------------------" while input>=0: xidList=AdminControl.invoke(mebean , "getPreparedTransactions").splitlines() print "--- Prepared Transactions ---" index=0 for xid in xidList: print " Index=%s XID=%s" % (index , xid) index+=1 print "------- End of list ---------" print "Select index of XID to commit/rollback" print "(or enter -1 to skip to next ME):" input=int(sys.stdin.readline().strip()) if input<0: print "No index selected." else: xid=xidList[input] print "Enter c to commit or r to rollback XID %s" % xid input=sys.stdin.readline().strip() if input=="c": print "Committing xid=%s" % xid AdminControl.invoke(mebean , "commitPreparedTransaction" , xid) if input=="r": print "Rolling back xid=%s" % xid AdminControl.invoke(mebean , "rollbackPreparedTransaction" , xid) print print "--- End ME --------------------" print print "No more ME definitions found, exiting"This script lists the transaction identities of the transactions together with an index. We can then select an index and commit or roll back the transaction corresponding to that index.
- Use the administrative console to find the transaction identity of messages that have indoubt transactions.
- Optional: If a transaction identity appears in the transaction management panel, commit or roll back the transactions as required.
- Optional: If a transaction identity does not appear in the transaction management panel, use the methods on the messaging engine MBean. For example, use a script to display a list of transaction identities for indoubt transactions. For each transaction:
- Enter the index of the transaction identity of the transaction.
- Optional: Enter c to commit the transaction.
- Optional: Enter r to roll back the transaction.
- To check that transactions are no longer indoubt, restart the server and use the transaction management panel, or methods on the messaging engine MBean to check.
Related tasks
Deploy the Resource Adapter for JMS with WebSphere Application Server to a third party application server Listing messages on a message point Manage active and prepared transactions by Troubleshooting service integration technologies