The XA Resource Manager Swiftlet is the central XA resource to a router. Only because of simplification reasons it is a component of the standard distribution (it does not consume any resources). Together with the JMS XA/ASF Swiftlet and the Routing Swiftlet it is responsible for the administration of so called in-doubt transactions. These are unfinished prepared XA transactions.
On startup, the XA Resource Manager Swiftlet checks if prepared XA transactions are stored within the Store Swiftlet. In this case it reconstructs these transactions incl. all locks. A warning message is displayed during the startup with the hint to commit or to abort these transactions manually via the SwiftMQ Explorer or via CLI.
The Swiftlet has 2 attributes to configure, a scan interval and a transaction timeout.
The "Prepared XA Transactions" node of the Swiftlet contains transactions in a prepared state. The update of this node consumes time and resources and is therefore made ansychronously. The scan interval value determines in which intervals the Swiftlet checks for pending XA transactions which are in a prepared state and enlists these below the "Prepared XA Transactions" node. The default value is 120000 ms (2 minutes) which is quite enough to enlist indoubt XA transactions here for manual commit/rollback.
A transaction timeout is the time after which a running and not yet prepared XA transaction is aborted (rolled back). The sense is to avoid long running transactions and lock exhaustions. The value of this attribute is the default value. A transaction manager of an application server is able to get and set this value via the resp. methods of SwiftMQ's XAResource. The default value is 0 which means no timeout.
This chapter explains the heuristic commit/rollback of in-doubt XA transactions.
The list of in-doubt transactions is located within the "Usage / Prepared XA Transactions" folder of the XA Resource Manager Swiftlet:
You have to select the respective transaction, press the right mouse button and you may now choose between commit/rollback:
The entity table of the usage folder may also be displayed and you may select the respective line and activate the commit/rollback by the respective buttons:
Example:
Welcome to SwiftMQ!
Username:
Password:
Trying to connect ... connected
Type 'help' to get a list of available commands.
> Router 'router1' is available for administration.
> sr r
router1> cc sys$xa
router1/sys$xa> cc usage/prepared-tx
router1/sys$xa/usage/prepared-tx> lc
Entity List: Prepared XA Transactions
Description: Prepared XA Transactions
Entities in this List:
----------------------
1
2
3
4
router1/sys$xa/usage/prepared-tx> rollback 3
router1/sys$xa/usage/prepared-tx> commit 4
router1/sys$xa/usage/prepared-tx> lc
Entity List: Prepared XA Transactions
Description: Prepared XA Transactions
Entities in this List:
----------------------
1
2
router1/sys$xa/usage/prepared-tx>
According to the XA specification, an XA resource has to store information about heuristically completed XA transctions until the driving transaction manager commands to forget it. Therefore, when an XA transaction has been heuristical completed with SwiftMQ Explorer or CLI, it is still stored under folder "Usage / Heuristically completed XA Transactions" until the recovery is started by a transaction manager:
If an automatic recovery is not done by a transaction manager for any reason, the entries can be manually deleted: