Apache ShardingSphere provides XA transactions that integrate with the Bitronix implementation.
Introducing Maven dependency
<properties>
<btm.version>2.1.3</btm.version>
</properties>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<!-- This module is required when using XA transactions -->
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-core</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-bitronix</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.btm</groupId>
<artifactId>btm</artifactId>
<version>${btm.version}</version>
</dependency>
Yaml:
- !TRANSACTION
defaultType: XA
providerType: Bitronix
See Bitronix’s Official Documentation for more details.