9.6.2. Transactional Datasource Configuration
9.6.2.1. Configure Your Datasource to Use JTA Transactions
This task shows you how to enable Java Transactions API (JTA) on your datasource.
You must meet the following conditions before continuing with this task:
- Your database or other resource must support JTA. If in doubt, consult the documentation for your database or other resource.
- Create a datasource. Refer to Section 9.6.2.4, “Create a Non-XA Datasource with the Management Interfaces”.
- Stop the JBoss Enterprise Application Platform.
- Have access to edit the configuration files directly, in a text editor.
Procedure 9.1. Task:
Open the configuration file in a text editor.
Depending on whether you run the JBoss Enterprise Application Platform in a managed domain or standalone server, your configuration file will be in a different location.Managed domain
The default configuration file for a managed domain is inEAP_HOME/domain/configuration/domain.xmlfor Red Hat Enterprise Linux, andEAP_HOME\domain\configuration\domain.xmlfor Microsoft Windows Server.Standalone server
The default configuration file for a standalone server is inEAP_HOME/standalone/configuration/standalone.xmlfor Red Hat Enterprise Linux, andEAP_HOME\standalone\configuration\standalone.xmlfor Microsoft Windows Server.
Locate the
<datasource>tag that corresponds to your datasource.The datasource will have thejndi-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">
Set the
jtaattribute totrue.Add the following to the contents of your<datasource>tag, as they appear in the previous step:jta="true"Save the configuration file.
Save the configuration file and exit the text editor.Start the JBoss Enterprise Application Platform.
Relaunch the JBoss Enterprise Application Platform 6 server.
The JBoss Enterprise Application Platform starts, and your datasource is configured to use JTA transactions.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.