Resolving indoubt transactions
Use this task to resolve indoubt transactions and the messages associated with them.
About this task
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.
- Using the server transaction management panels
- Using methods on the messaging engine MBean
You must first attempt to resolve the indoubt transaction by using the application server transaction management MBean interfaces. These are documented in Managing active and prepared transactions by using wsadmin scripting. 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.
- getPreparedTransactions()
- commitPreparedTransaction(String xid)
- rollbackPreparedTransaction(String xid)
wsadmin>AdminControl.invoke(AdminControl.queryNames("type=SIBMessagingEngine,*").
splitlines()[0] , "getPreparedTransactions")
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. You can then select an index and commit or roll back the transaction corresponding to that index.