![Use XA Transactions field selected](_images/database-connector-xatransactions.png)
Using XA Transactions in Database Connector
Anypoint Connector for Database (Database Connector) provides the option to use Extended Architecture Transactions (XA Transactions) when you enable the Use XA Transactions field in the Database Connector global configuration.
Before You Begin
Before getting started, ensure that you have an understanding of XA Transactions
Use XA Transactions
You can enable the Use XA Transactions field in the database global connector configuration for the Derby Connection, Generic Connection, Microsoft SQL Server Connection, MySQL Connection, and Oracle Connection. For a Data Source Reference Connection, refer to the Configure a Data Source Reference Connection When in XA Transaction Mode topic.
When you enable Use XA Transactions the connection pooling is created as well. |
The following example shows how to configure Use XA Transactions for the MySQL Connection in Anypoint Studio:
-
In Studio, navigate to the Global Elements tab.
-
Click Create.
-
In the search bar, type
database
. -
Select Database Config.
-
Click OK.
-
In the Global Element Properties window, select MySQL Connection in the Connection field.
-
Select the Transactions tab.
-
Select Use XA Transactions, which indicates that the created data source must support XA transactions.
Note that the implementation creates an Enhydra XADatasource. -
Configure other required database configurations in the General and Advanced tabs.
-
Click OK.
![Use XA Transactions field selected](_images/database-connector-xatransactions.png)
In the Configuration XML editor window, the configuration looks like this:
<db:config name="Database_Config" doc:name="Database Config" >
<db:derby-connection useXaTransactions="true" />
</db:config>