Contact Us 1-800-596-4880

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:

  1. In Studio, navigate to the Global Elements tab.

  2. Click Create.

  3. In the search bar, type database.

  4. Select Database Config.

  5. Click OK.

  6. In the Global Element Properties window, select MySQL Connection in the Connection field.

  7. Select the Transactions tab.

  8. Select Use XA Transactions, which indicates that the created data source must support XA transactions.
    Note that the implementation creates an Enhydra XADatasource.

  9. Configure other required database configurations in the General and Advanced tabs.

  10. Click OK.

Use XA Transactions field selected

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" />
View on GitHub