WebSphere WebSphere Application Server Express, Version 6.0.x Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Resolving in-doubt transactions

Use this task to resolve in-doubt transactions and the messages associated with them.

Why and when to perform this task

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 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 in-doubt 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 should attempt to resolve the in-doubt transaction using the application server’s transaction management panels first. You navigate to these panels in the administrative console by clicking Servers > server1 > Resources > Transactions > Runtime > Imported prepared transactions - Review. 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.

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:
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 in-doubt 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 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:

Steps for this task

  1. Use the administrative console to find the transaction identity of messages that have in-doubt 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 in-doubt 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 in-doubt, restart the server and use the transaction management panel, or methods on the messaging engine's MBean to check.
Related tasks
Listing messages on a message point
Troubleshooting service integration technologies

Task topic

Terms of Use | Feedback

Last updated: 2 Aug 2005
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.websphere.pmc.express.doc\tasks\tjm0165_.html

© Copyright IBM Corporation 2004, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)