6.4. XA Datasources
6.4.1. Create an XA Datasource with the Management Interfaces
Summary
This topic covers the steps required to create an XA datasource, using either the Management Console or the Management CLI.
Prerequisites
Note
Prior to version 10.2 of the Oracle datasource, the <no-tx-separate-pools/> parameter was required, as mixing non-transactional and transactional connections would result in an error. This parameter may no longer be required for certain applications.
Procedure 6.7. Create an XA Datasource, Using Either the Management CLI or the Management Console
Management CLI
- Run the following command to create an XA datasource, configuring the variables as appropriate:
xa-data-source add --name=XA_DATASOURCE_NAME --jndi-name=JNDI_NAME --driver-name=DRIVER_NAME --xa-datasource-class=XA_DATASOURCE_CLASS
Configure the XA datasource properties
Set the server name
Run the following command to configure the server name for the host:/subsystem=datasources/xa-data-source=XA_DATASOURCE_NAME/xa-datasource-properties=ServerName:add(value=HOSTNAME)
Set the database name
Run the following command to configure the database name:/subsystem=datasources/xa-data-source=XA_DATASOURCE_NAME/xa-datasource-properties=DatabaseName:add(value=DATABASE_NAME)
- Enable the datasource:
xa-data-source enable --name=XA_DATASOURCE_NAME
Management Console
Navigate to the Datasources panel in the Management Console
Standalone Mode
Select the Profile tab from the top-right of the console.Domain Mode
- Select the Profiles tab from the top-right of the console.
- Select the appropriate profile from the drop-down box in the top left.
- Expand the Subsystems menu on the left of the console.
- Select Connector → Datasources from the menu on the left of the console.
Figure 6.4. Datasources panel
- Select the XA Datasource panel.
Create a new XA datasource
- Select the Add button at the top of the XA Datasources panel.
- Enter the new XA datasource attributes in the Create XA Datasource wizard and proceed with the Next button.
- Enter the JDBC driver details in the Create XA Datasource wizard and proceed with the Next button.
- Edit the XA properties and proceed with the Next button.
- Enter the connection settings in the Create XA Datasource wizard and select the Done button.
Result
The XA datasource has been added to the server. It is now visible in either the standalone.xml
or domain.xml
file, as well as the management interfaces.
- To configure the datasource further, refer here: Section 6.4.2, “Modify an XA Datasource with the Management Interfaces”.
- To remove the datasource, refer here: Section 6.4.3, “Remove an XA Datasource with the Management Interfaces”.