15.2. Transaction Administration

15.2.1. Browse and Manage Transactions

The command-line based Management CLI supports the ability to browse and manipulate transaction records. This functionality is provided by the interaction between the Transaction Manager and the Management API of JBoss Enterprise Application Platform 6.
The transaction manager stores information about each pending transaction and the participants involved the transaction, in a persistent storage called the object store. The Management API exposes the object store as a resource called the log-store. An API operation called probe reads the transaction logs and creates a node for each log. You can call the probe command manually, whenever you need to refresh the log-store. It is normal for transaction logs to appear and disappear quickly.

Example 15.1. Refresh the Log Store

This command refreshes the Log Store for server groups which use the profile default in a managed domain. For a standalone server, remove the profile=default from the command.

Example 15.2. View All Prepared Transactions

To view all prepared transactions, first refresh the log store (see Example 15.1, “Refresh the Log Store”), then run the following command, which functions similarly to a filesystem ls command.
ls /profile=default/subsystem=transactions/log-store=log-store/transactions
Each transaction is shown, along with its unique identifier. Individual operations can be run against an individual transaction (see Manage a Transaction).

Manage a Transaction

View a transaction's attributes.
To view information about a transaction, such as its JNDI name, EIS product name and version, or its status, use the :read-resource CLI command.
View the participants of a transaction.
Each transaction log contains a child element called participants. Use the read-resource CLI command on this element to see the participants of the transaction. Participants are identified by their JNDI names.
The result may look similar to this:
   "outcome" => "success",
   "result" => {
       "eis-product-name" => "HornetQ",
       "eis-product-version" => "2.0",
       "jndi-name" => "java:/JmsXA",
       "status" => "HEURISTIC",
       "type" => "/StateManager/AbstractRecord/XAResourceRecord"
The outcome status shown here is in a HEURISTIC state and is eligible for recover. Refer to Recover a transaction. for more details.
Delete a transaction.
Each transaction log supports a :delete operation, to delete the transaction log representing the transaction.
Recover a transaction.
Each transaction log supports recovery via the :recover CLI command.

Recovery of Heuristic Transactions and Participants

  • If the transaction's status is HEURISTIC, the recovery operation changes the state to PREPARE and triggers a recovery.
  • If one of the transaction's participants is heuristic, the recovery operation tries to reply the commit operation. If successful, the participant is removed from the transaction log. You can verify this by re-running the :probe operation on the log-store and checking that the participant is no longer listed. If this is the last participant, the transaction is also deleted.
Refresh the status of a transaction which needs recovery.
If a transaction needs recovery, you can use the :refresh CLI command to be sure it still requires recovery, before attempting the recovery.


For JTS transactions, if participants are on remote servers, a limited amount of information may be available to the Transaction Manager. In this case, it is recommended that you use the file-based object store, rather than the HornetQ storage mode. This is the default behavior. To use the HornetQ storage mode, you can set the value of the use-hornetq-store option to true, in the Transaction Manager configuration. Refer to Section 15.1.3, “Configure Your Datasource to Use JTA Transactions” for information on configuring the Transaction Manager.
View Transaction Statistics

You can view statistics about the Transaction Manager and transaction subsystem either via the web-based Management Console or the command-line Management CLI.

In the web-based Management Console, Transaction statistics are available via RuntimeSubsystem MetricsTransactions. Transaction statistics are available for each server in a managed domain, as well. You can specify the server in the Server selection box at the top left.
The following table shows each available statistic, its description, and the CLI command to view the statistic.

Table 15.4. Transaction Subsystem Statistics

Statistic Description CLI Command
The total number of transactions processed by the Transaction Manager on this server.
The number of committed transactions processed by the Transaction Manager on this server.
The number of aborted transactions processed by the Transaction Manager on this server.
Timed Out
The number of timed out transactions processed by the Transaction Manager on this server.
Not available in the Management Console. Number of transactions in a heuristic state.
In-Flight Transactions
Not available in the Management Console. Number of transactions which have begun but not yet terminated.
Failure Origin - Applications
The number of failed transactions whose failure origin was an application.
Failure Origin - Resources
The number of failed transactions whose failure origin was a resource.