Use this task to resolve in-doubt transactions and the messages associated with them.
Transactions may become stuck in the in-doubt state indefinitely due to an exceptional circumstance such as the removal of a node causing messaging engines to be destroyed. When a transaction becomes in-doubt, it must be committed or rolled back so that normal processing by the affected messaging engine can continue.
You should first attempt to resolve the in-doubt transaction using the application server transaction management panels. You navigate to these panels in the administrative console by clicking
server-name . If the transaction identity appears in the resulting panel, you can commit or roll back the transaction. If the transaction identity does not appear in the panel, the transaction identity was not enlisted with the Transaction Service on the server. In this case only, you should use methods on the MBean to display a list of the identities of the in-doubt transactions managed directly by the messaging engine.wsadmin> $AdminControl invoke [$AdminControl queryNames type=SIBMessagingEngine,*] getPreparedTransactionsAlternatively, you can use a script such as the following to invoke the methods on the MBean:
set mbean [$AdminControl queryNames type=SIBMessagingEngine,*] set input 0 while {$input >=0} { set xidList [$AdminControl invoke $mbean getPreparedTransactions] puts "----Prepared Transactions----" set index 0 foreach xid $xidList { puts " Index=$index XID=$xid" incr index } puts "------- End of list ---------" puts "Select index of XID to commit/rollback:" set input [gets stdin] if {$input < 0 } { puts "No index selected, exitting." } else { set xid [lindex $xidList $input] puts "Enter c to commit or r to rollback XID $xid" set input [gets stdin] if {$input == "c"} { puts "Committing xid=$xid" $AdminControl invoke $mbean commitPreparedTransaction $xid } if {$input == "r"} { puts "Rolling back xid=$xid" $AdminControl invoke $mbean rollbackPreparedTransaction $xid } } puts "" }
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.
In summary, to identify and resolve in-doubt transactions: