Chapter 19. Transaction Subsystem
19.1. Transaction Subsystem Configuration
19.1.1. Transactions Configuration Overview
The following procedures show you how to configure the transactions subsystem of JBoss EAP 6.
19.1.2. Configure the Transaction Manager
default, you may need to modify the steps and commands in the following ways.
Notes about the Example Commands
- For the Management Console, the
defaultprofile is the one which is selected when you first log into the console. If you need to modify the Transaction Manager's configuration in a different profile, select your profile instead of
default, in each instruction.Similarly, substitute your profile for the
defaultprofile in the example CLI commands.
- If you use a Standalone Server, only one profile exists. Ignore any instructions to choose a specific profile. In CLI commands, remove the
/profile=defaultportion of the sample commands.
transactionssubsystem must be enabled. It is enabled by default, and required for many other subsystems to function properly, so it is very unlikely that it would be disabled.
To configure the TM using the web-based Management Console, select the Configuration tab from the top of the screen. If you use a managed domain, choose the correct profile from the Profile selection box at the top left. Expand the Container menu and select Transactions.
In the Management CLI, you can configure the TM using a series of commands. The commands all begin with
/profile=default/subsystem=transactions/ for a managed domain with profile
/subsystem=transactions for a Standalone Server.
Table 19.1. TM Configuration Options
Whether to enable transaction statistics. These statistics can be viewed in the Management Console in the Subsystem Metrics section of the Runtime tab.
Enable TSM Status
Whether to enable the transaction status manager (TSM) service, which is used for out-of-process recovery. Running an out of process recovery manager to contact the ActionStatusService from different process is not supported (it is normally contacted in memory).
This configuration option is unsupported.
The default transaction timeout. This defaults to
Object Store Path
A relative or absolute filesystem path where the TM object store stores data. By default relative to the
Object Store Path Relative To
References a global path configuration in the domain model. The default value is the data directory for JBoss EAP 6, which is the value of the property
Specifies the name of the socket binding used by the Transaction Manager for recovery and generating transaction identifiers, when the socket-based mechanism is used. Refer to
Status Socket Binding
Specifies the socket binding to use for the Transaction Status manager.
This configuration option is unsupported.
Whether or not the Transaction Recovery process should listen on a network socket. Defaults to
Table 19.2. Advanced TM Configuration Options
Whether to use Java Transaction Service (JTS) transactions. Defaults to
The node identifier for the Transaction Manager. This option is required in the following situations:
The Transaction Manager creates a unique identifier for each transaction log. Two different mechanisms are provided for generating unique identifiers: a socket-based mechanism and a mechanism based on the process identifier of the process.
In the case of the socket-based identifier, a socket is opened and its port number is used for the identifier. If the port is already in use, the next port is probed, until a free one is found. The
The name of the socket binding configuration to use if the transaction manager should use a socket-based process id. Will be
Use HornetQ's journaled storage mechanisms instead of file-based storage, for the transaction logs. This is disabled by default, but can improve I/O performance. It is not recommended for JTS transactions on separate Transaction Managers. When changing this option, the server has to be restarted using the
19.1.3. Configure Your Datasource to Use JTA Transaction API
This task shows you how to enable Java Transaction API (JTA) on your datasource.
You must meet the following conditions before continuing with this task:
- Your database or other resource must support Java Transaction API. If in doubt, consult the documentation for your database or other resource.
- Create a datasource. Refer to Section 6.3.1, “Create a Non-XA Datasource with the Management Interfaces”.
- Stop JBoss EAP 6.
- Have access to edit the configuration files directly, in a text editor.
Procedure 19.1. Configure the Datasource to use Java Transaction API
Open the configuration file in a text editor.Depending on whether you run JBoss EAP 6 in a managed domain or standalone server, your configuration file will be in a different location.
Managed domainThe default configuration file for a managed domain is in
EAP_HOME/domain/configuration/domain.xmlfor Red Hat Enterprise Linux, and
EAP_HOME\domain\configuration\domain.xmlfor Microsoft Windows Server.
Standalone serverThe default configuration file for a standalone server is in
EAP_HOME/standalone/configuration/standalone.xmlfor Red Hat Enterprise Linux, and
EAP_HOME\standalone\configuration\standalone.xmlfor Microsoft Windows Server.
<datasource>tag that corresponds to your datasource.The datasource will have the
jndi-nameattribute set to the one you specified when you created it. For example, the ExampleDS datasource looks like this:
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
true.Add the following to the contents of your
<datasource>tag, as they appear in the previous step:
jta="true"Unless you have a specific use case (such as defining a read only datasource) Red Hat discourages overriding the default value of
jta=true. This setting indicates that the datasource will honor the Java Transaction API and allows better tracking of connections by the JCA implementation.
Save the configuration file.Save the configuration file and exit the text editor.
Start JBoss EAP 6.Relaunch the JBoss EAP 6 server.
JBoss EAP 6 starts, and your datasource is configured to use Java Transaction API.
19.1.4. Configure an XA Datasource
Log into the Management Console.
Add a new datasource.Add a new datasource to JBoss EAP 6. Click the XA Datasource tab at the top.
NoteRefer to Create an XA Datasource with the Management Interfaces section of the Administration and Configuration Guide on the Red Hat Customer Portal for information on how to add a new datasource to JBoss EAP 6.
Configure additional properties as appropriate.All datasource parameters are listed in Section 6.7.1, “Datasource Parameters”.
Your XA Datasource is configured and ready to use.
19.1.5. About Transaction Log Messages
DEBUGlog level for the transaction logger. For detailed debugging, use the
TRACElog level. Refer to Section 19.1.6, “Configure Logging for the Transaction Subsystem” for information on configuring the transaction logger.
TRACElog level. Following are some of the most commonly-seen messages. This list is not comprehensive, so you may see other messages than these.
Table 19.3. Transaction State Change
|Transaction Begin|| |
When a transaction begins, the following code is executed:
tsLogger.logger.trace("BasicAction::Begin() for action-id "+ get_uid());
|Transaction Commit|| |
When a transaction commits, the following code is executed:
tsLogger.logger.trace("BasicAction::End() for action-id "+ get_uid());
|Transaction Rollback|| |
When a transaction rolls back, the following code is executed:
tsLogger.logger.trace("BasicAction::Abort() for action-id "+ get_uid());
|Transaction Timeout|| |
When a transaction times out, the following code is executed:
tsLogger.logger.trace("Reaper Worker " + Thread.currentThread() + " attempting to cancel " + e._control.get_uid());
You will then see the same thread rolling back the transaction as shown above.
19.1.6. Configure Logging for the Transaction Subsystem
Use this procedure to control the amount of information logged about transactions, independent of other logging settings in JBoss EAP 6. The main procedure shows how to do this in the web-based Management Console. The Management CLI command is given afterward.
Procedure 19.2. Configure the Transaction Logger Using the Management Console
Navigate to the Logging configuration area.In the Management Console, click the Configuration tab. If you use a managed domain, choose the server profile you wish to configure, from the Profile selection box at the top left.Expand the Core menu, and select Logging.
com.arjunaattributes.Select the Log Categories tab. Select
com.arjunaand lick Edit in the Details section. This is where you can add class-specific logging information. The
com.arjunaclass is already present. You can change the log level and whether to use parent handlers.
- Log Level
- The log level is
WARNby default. Because transactions can produce a large quantity of logging output, the meaning of the standard logging levels is slightly different for the transaction logger. In general, messages tagged with levels at a lower severity than the chosen level are discarded.
Transaction Logging Levels, from Most to Least Verbose
- Use Parent Handlers
- Whether the logger should send its output to its parent logger. The default behavior is
- Changes take effect immediately.