This section describes the MBeans used for managing transactions:
The transaction manager configuration MBean configures transactions.
The transaction manager monitor MBean monitors transactions.
The following subsections describe each of these MBeans in detail.
Notice that there are no resource MBeans associated with individual transactions; rather, all transactions are managed through the broker's global transaction manager configuration and transaction manager monitor MBeans.
Each broker has a single transaction manager configuration MBean, used for configuring all of the broker's transactions.
The transaction manager configuration MBean has the following object name:
com.sun.messaging.jms.server:type=TransactionManager,subtype=Config
A string representing this object name is defined as a static constant TRANSACTION_MANAGER_CONFIG_MBEAN_NAME in the utility class MQObjectName.
The transaction manager configuration MBean has the attribute shown in Table 2–66. The name of this attribute is defined as a static constant in the utility class TransactionAttributes.
Table 2–66 Transaction Manager Configuration Attribute
Name |
Type |
Settable? |
Description |
---|---|---|---|
Integer |
No |
Current number of open transactions |
The transaction manager configuration MBean supports the operations shown in Table 2–67. The names of these operations are defined as static constants in the utility class TransactionOperations.
Table 2–67 Transaction Manager Configuration Operations
Each broker has a single transaction manager monitor MBean, used for monitoring all of the broker's transactions.
The transaction manager monitor MBean has the following object name:
com.sun.messaging.jms.server:type=TransactionManager,subtype=Monitor
A string representing this object name is defined as a static constant TRANSACTION_MANAGER_MONITOR_MBEAN_NAME in the utility class MQObjectName.
The transaction manager monitor MBean has the attributes shown in Table 2–68. The names of these attributes are defined as static constants in the utility class TransactionAttributes.
Table 2–68 Transaction Manager Monitor Attributes
Name |
Type |
Settable? |
Description |
Integer |
No |
Current number of open transactions |
|
Long |
No |
Cumulative number of transactions committed since broker started |
|
Long |
No |
Cumulative number of transactions rolled back since broker started |
The transaction manager monitor MBean supports the operations shown in Table 2–69. The names of these operations are defined as static constants in the utility class TransactionOperations.
Table 2–69 Transaction Manager Monitor Operations
Name |
Parameters |
Return Type |
Description |
---|---|---|---|
None |
String[] | ||
transaction (String) |
CompositeData |
Descriptive information about transaction The desired transaction is designated by its transaction identifier (transactionID). The value returned is a JMX CompositeData object describing the transaction; see Table 2–70 for lookup keys used with this object. |
|
None |
CompositeData[] |
Descriptive information about all current open transactions The value returned is an array of JMX CompositeData objects describing the transactions; see Table 2–70 for lookup keys used with these objects. |
The getTransactionInfoByID and getTransactionInfo operations return objects implementing the JMX interface CompositeData, which maps lookup keys to associated data values. The keys shown in Table 2–70 are defined as static constants in the utility class TransactionInfo for use with these objects.
Table 2–70 Lookup Keys for Transaction Information
Name |
Value Type |
Description |
---|---|---|
String | ||
String |
(Distributed transactions only) Distributed transaction identifier (XID) |
|
String |
User name |
|
String |
Client identifier |
|
String |
Connection string |
|
Long |
Time created, in standard Java format (milliseconds since January 1, 1970, 00:00:00 UTC) |
|
Integer |
Current state See Table 2–71 for possible values. |
|
String |
String representation of current state Useful for displaying the state in human-readable form, such as in the Java Monitoring and Management Console (jconsole). See Table 2–71 for possible values. |
|
Long |
Number of messages |
|
Long |
Number of acknowledgments |
Table 2–71 shows the possible values returned for the lookup keys State and StateLabel. These values are defined as static constants in the utility class TransactionState.
Table 2–71 Transaction State Values
Value |
Utility Constant |
String Representation |
Meaning |
---|---|---|---|
0 |
CREATED |
Transaction created |
|
1 |
STARTED |
Transaction started |
|
2 |
TransactionState.FAILED |
FAILED |
Transaction has failed |
3 |
INCOMPLETE |
Transaction incomplete |
|
4 |
COMPLETE |
Transaction complete |
|
5 |
PREPARED |
(Distributed transactions only) Transaction in prepared state |
|
6 |
COMMITTED |
Transaction committed |
|
7 |
ROLLEDBACK |
Transaction rolled back |
|
8 |
TIMED_OUT |
Transaction has timed out |
|
-1 |
UNKNOWN |
Transaction state unknown |
The transaction manager monitor MBean supports the notifications shown in Table 2–72. These notifications are instances of the Message Queue JMX class TransactionNotification, and their names are defined as static constants in that class.
Table 2–72 Transaction Manager Monitor Notifications
Name |
Utility Constant |
Description |
---|---|---|
(Distributed transactions only) Transaction has entered prepared state |
||
Transaction committed |
||
Transaction rolled back |
Table 2–73 shows the method defined in class TransactionNotification for obtaining details about a transaction manager monitor notification.
Table 2–73 Data Retrieval Method for Transaction Manager Monitor Notifications
Method |
Return Type |
Description |
---|---|---|
String |