Chapter 2. Configuring Transactions
2.1. Unique Node Identifier
Unique node identifier allows JBoss EAP to recover transactions and transaction states that match only the specified node identifier. You can set the node identifier using the
2.1.1. Importance of the Unique Node Identifier
When running XA recovery, you must configure the
Xid types that JBoss EAP transactions can recover. Each
Xid has the unique node identifier encoded in it and JBoss EAP only recovers the transactions and transaction states that match the specified node identifier.
You can configure the node identifier using the
JTAEnvironmentBean.xaRecoveryNodes property, which can include multiple values in a list.
A value of asterisk
"*" forces JBoss EAP to recover, and possibly rollback, all the transactions irrespective of their node identifiers. It must be used with caution.
The value of
com.arjuna.ats.jta.xaRecoveryNode property must be alphanumeric and must match the value of the
2.2. Configuring the Transaction Manager
You can configure the transaction manager using the web-based management console or the command line management CLI.
Configuring the Transaction Manager Using the Management Console
The following steps explain how to configure the transaction manager using the web-based management console:
- Select the Configuration tab from the top of the screen.
- If you are running JBoss EAP as a managed domain, choose the desired profile to modify.
- From the Subsystem list, select Transaction and click View.
- Select the appropriate tab for the settings that you want to configure, such as Recovery for recovery options.
- Click Edit, make the necessary changes, and click Save to save the changes.
Configuring the Transaction Manager Using the Management CLI
Using the management CLI, you can configure the transaction manager using a series of commands. The commands all begin with
/subsystem=transactions for a standalone server or
/profile=default/subsystem=transactions/ for the
default profile in a managed domain.
For a detailed listing of all the transaction manager configuration options, see the Transaction Manager Configuration Options for JBoss EAP.
2.3. Configuring the Transaction Manager Using System Properties
You can use either the management console, management CLI, or the system properties to configure many of the Transaction Manager options. However, the following options are configurable only using system properties. They are not configurable using the management CLI or management console.
Interval between recovery attempts, in seconds.
Interval between the first and second recovery passes, in seconds.
Interval before first recovery pass, in seconds.
Interval between expiry scans, in hours.
This example shows how to configure these system properties in the
standalone.xml server configuration file.
<system-properties> <property name="RecoveryEnvironmentBean.periodicRecoveryPeriod" value="180"/> <property name="RecoveryEnvironmentBean.recoveryBackoffPeriod" value="20"/> <property name="RecoveryEnvironmentBean.periodicRecoveryInitializationOffset" value="5"/> <property name="RecoveryEnvironmentBean.expiryScanInterval" value="24"/> </system-properties>
For more information on how to configure system properties, see System Properties in the Configuration Guide.
2.4. Configuring Your Datasource to Use Jakarta Transactions
This task shows you how to enable Jakarta Transactions on your datasource.
- Your database must support Jakarta Transactions. For more information, see the documentation from your database vendor.
- Create a non-XA datasource. For instructions, see the Configuration Guide.
XA datasources, as described in the Configuration Guide, are Jakarta Transactions capable by default.
Configuring the Datasource to use Jakarta Transactions
Use the following management CLI command to set the
In a managed domain, precede this command with
Reload the server for the changes to take effect.
Your datasource is now configured to use Jakarta Transactions.
2.5. Configuring the ORB for JTS
In a default installation of JBoss EAP, the Object Request Broker (ORB) support for transactions is disabled. You can configure ORB settings in the
iiop-openjdk subsystem using the management CLI or the management console.
iiop-openjdk subsystem is available when using the full or full-ha profile in a managed domain, or the
standalone-full-ha.xml configuration file for a standalone server.
For a listing of the available configuration options for the
iiop-openjdk subsystem, see IIOP Subsystem Attributes in the Configuration Guide.
Configure the ORB Using the Management CLI
You can configure each aspect of the ORB using the management CLI. This is the minimum configuration for the ORB to be used with JTS.
You can configure the following management CLI commands for a managed domain using the
full profile. If necessary, change the profile to suit the one you need to configure. If you are using a standalone server, omit the
/profile=full portion of the commands.
Enable the Security Interceptors
security attribute by setting the value to
Enable Transactions in the IIOP Subsystem
To enable the ORB for JTS, set the value of
transactions attribute to
full, rather than the default
Enable JTS in the Transactions Subsystem
For JTS activation, the server must be restarted as reload is not enough.
Configure the ORB Using the Management Console
- Select the Configuration tab from the top of the management console. In a managed domain, you must select the appropriate profile to modify.
- Select Subsystems → IIOP (OpenJDK) and click View.
- Click Edit and modify the attributes as needed.
- Click Save to save the changes.