Transactions can become stuck in the indoubt state indefinitely
due to exceptional circumstances, such as the removal of a node causing
messaging engines to be destroyed.
Before you begin
Use the procedure to resolve indoubt transactions only
if you have tried other procedures (such as restarting the server
in recovery mode), unsuccessfully.
About this task
When a transaction is stuck in the indoubt state, it must
either be committed or rolled back so that normal processing by the
affected messaging engine can continue.
You can use the administrative
console to display the messages causing the problem by Listing messages on a message point.
If
there are messages related to an indoubt transaction, the identity
of the transaction displays in a panel associated with the message.
You can then resolve the transaction in one of the following ways:
- Using the server's transaction management panels
- Using methods on the messaging engine's MBean
You should first attempt to resolve the indoubt transaction using the application server
transaction management panels. If this does not work, then use methods on the messaging engine's
MBean. These are described in the following section.
Procedure
- Using the application server transaction management
panels to resolve indoubt transactions
- Navigate to the transaction management panels in the
administrative console
- If the transaction identity appears in the resulting
panel, you can commit or roll back the transaction
Choose
the option to 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 (as described in the next
step) to display a list of the identities of the indoubt transactions
managed directly by the messaging engine.
- Using methods on the messaging engine's MBean to resolve
indoubt transactions
CAUTION:
Only perform
this step if you were unable to display the transaction identity by
using the server's transaction management panels
- The following methods on the messaging engine's 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, you can use a wsadmin command,
for example, you can use a command of the following form to obtain
a list of the indoubt transaction identities from a messaging engine's
MBean:
wsadmin> $AdminControl invoke [$AdminControl queryNames type=SIBMessagingEngine,*] getPreparedTransactions
Alternatively,
you can use a script such as the following to invoke the methods on
the MBean:
foreach mbean [$AdminControl queryNames type=SIBMessagingEngine,*] {
set input 0
while {$input >=0} {
set xidList [$AdminControl invoke $mbean getPreparedTransactions]
set meCfgId [$AdminControl getConfigId $mbean]
set endIdx [expr {[string first "(" $meCfgId] - 1}]
set me [string range ${meCfgId} 0 $endIdx]
puts "----Prepared Transactions for ME $me ----"
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 (-1 to continue) :"
set input [gets stdin]
if {$input < 0 } {
puts "No index selected, going to continue."
} 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.
Results
In summary, to identify and resolve indoubt transactions:
- Use the administrative console to find the transaction identity
of indoubt transactions.
- If a transaction identity appears in the transaction management
panel, commit or roll back the transactions as required.
- If a transaction identity does not appear in the transaction management
panel, use the methods on the messaging engine's 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.
- Enter c to commit the transaction
- 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's MBean.