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.

You 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. You can then resolve the transaction in two ways:
  1. Using the server's transaction management panels
  2. Using methods on the messaging engine's MBean

You must first attempt to resolve the indoubt transaction using the application server transaction management MBean interfaces. These are documented in Managing active and prepared transactions using scripting. Use the scripts for all application servers which may 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'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:
set mebeans [$AdminControl queryNames type=SIBMessagingEngine,*]  

foreach mebean $mebeans {
  set input 0 
  set meName []
  puts "--- Start ME: ---------------"
  puts "$mebean"
  puts "-----------------------------"
  while {$input >=0} {
    set xidList [$AdminControl invoke $mebean 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 (or press enter to skip to next ME):"
    set input [gets stdin] 
    
    if {$input < 0 } {
      puts "No index selected."
    } 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 $mebean commitPreparedTransaction $xid
      }
      if {$input == "r"} {
        puts "Rolling back xid=$xid"
        $AdminControl invoke $mebean rollbackPreparedTransaction $xid
      }
    }
    puts ""
  }
  puts "--- End ME ------------------"
  puts ""
}

puts "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.

Procedure

  1. Use the administrative console to find the transaction identity of messages that have indoubt transactions.
  2. Optional: If a transaction identity appears in the transaction management panel, commit or roll back the transactions as required.
  3. Optional: 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:
    1. Enter the index of the transaction identity of the transaction.
    2. Optional: Enter c to commit the transaction.
    3. Optional: Enter r to roll back the transaction.
  4. 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 to check.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Sep 20, 2010 9:00:59 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=vela&product=was-nd-dist&topic=tjm0165_
File name: tjm0165_.html