---
schema_version: "1"
id: b177747839bdfb454fa324278df3808be016abc7dd75cddff4abb0113199627a
title: Database Connector での XA トランザクションの使用
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/db-connector/1.13/database-connector-xa-transactions.md
canonical_url: https://docs.mulesoft.com/jp/db-connector/1.13/database-connector-xa-transactions
source_site: docs.mulesoft.com
content_type: documentation
content_hash: b7318b195f9507c897975c74d746f1a334a2e6450159b320a85bce7e58feec97
description: MuleSoft Documentation Site
release: "1.13"
latest: false
---
# Database Connector での XA トランザクションの使用

Database Connector のグローバル設定で ​**\[Use XA Transactions (XA トランザクションを使用)\]**​ 項目を有効にすると、データベース用 Anypoint Connector (Database Connector) では拡張アーキテクチャトランザクション (XA トランザクション) を使用するオプションが提供されます。

## [](#始める前に)始める前に

始める前に、​[XA トランザクション](https://docs.mulesoft.com/mule-runtime/latest/xa-transactions)​について理解していることを確認します。

## [](#use-xa-transactions-xa-トランザクションを使用)Use XA Transactions (XA トランザクションを使用)

**\[Use XA Transactions (XA トランザクションを使用)\]**​ 項目は、​**\[Derby Connection (Derby 接続)\]**​、​**\[Generic Connection (汎用接続)\]**​、​**\[Microsoft SQL Server Connection (Microsoft SQL Server 接続)\]**​、​**\[MySQL Connection (MySQL 接続)\]**​、および ​**\[Oracle Connection (Oracle 接続)\]**​ のデータベースグローバルコネクタ設定で有効にすることができます。 **データソース参照接続**​については、​[「XA トランザクションモードでのデータソース参照接続」](https://docs.mulesoft.com/jp/db-connector/1.13/database-connector-connection#data-source-connection-xa)​を参照してください。

<table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content"><strong>[Use XA Transactions (XA トランザクションを使用)]</strong>​ を有効にすると、接続プーリングも作成されます。</td></tr></tbody></table>

次の例は、Anypoint Studio で ​**\[MySQL Connection (MySQL 接続)\]**​ の ​**\[Use XA Transactions (XA トランザクションを使用)\]**​ を設定する方法を示しています。

1. Studio で、​**\[Global Elements (グローバル要素)\]**​ タブに移動します。
2. **\[Create (作成)\]**​ をクリックします。
3. 検索バーに「​`database`​」(データベース) と入力します。
4. **\[Database Config (データベース設定)\]**​ を選択します。
5. **\[OK\]**​ をクリックします。
6. **\[Global Element Properties (グローバル要素のプロパティ)\]**​ ウィンドウの ​**\[Connection (接続)\]**​ 項目で ​**\[MySQL Connection (MySQL 接続)\]**​ を選択します。
7. **\[Transactions (トランザクション)\]**​ タブを選択します。
8. **\[Use XA Transactions (XA トランザクションを使用)\]**​ を選択します。これは、作成したデータソースで XA トランザクションをサポートする必要があるかどうかを示します。  
    この実装により Enhydra XADatasource が作成されます。
9. **\[General (一般)\]**​ および ​**\[Advanced (詳細)\]**​ タブで他の必須のデータベース設定を定義します。
10. **\[OK\]**​ をクリックします。

![選択した \[XA Transactions (XA トランザクション)\] 項目の使用](_images/database-connector-xatransactions.png)

**設定 XML**​ エディターウィンドウでは、設定は次のように記述されます。

```xml
<db:config name="Database_Config" doc:name="Database Config" >
		<db:derby-connection useXaTransactions="true" />
	</db:config>
```

## [](#関連情報)関連情報

- [Bitronix トランザクションマネージャーの設定](https://docs.mulesoft.com/mule-runtime/latest/using-bitronix-to-manage-transactions#configuring-the-bitronix-transaction-manager)