ShardingSphere-Proxy supports LOCAL, XA, BASE transactions, LOCAL transaction is default value, it is original transaction of relational database.
Default XA transaction manager of ShardingSphere is Atomikos. Users can customize Atomikos configuration items through adding jta.properties
in conf catalog of ShardingSphere-Proxy. Please refer to Official Documents of Atomikos for detailed configurations.
conf/lib
. The reference package is as follows:<properties>
<narayana.version>5.9.1.Final</narayana.version>
<jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
<jboss-logging.version>3.2.1.Final</jboss-logging.version>
</properties>
<dependency>
<groupId>org.jboss.narayana.jta</groupId>
<artifactId>jta</artifactId>
<version>${narayana.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.narayana.jts</groupId>
<artifactId>narayana-jts-integration</artifactId>
<version>${narayana.version}</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-transaction-spi</artifactId>
<version>${jboss-transaction-spi.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss-logging.version}</version>
</dependency>
xa-transaction-manager-type
in conf/server.yaml
:- !TRANSACTION
defaultType: XA
providerType: Narayana
jbossts-properties.xml
to customize Narayana configuration.
The order of path loading is user.dir (pwd)
> user.home
> java.home
> classpath
.
Please refer to Narayana official documentation for more details.conf/lib
. The reference package is as follows:<properties>
<btm.version>2.1.3</btm.version>
</properties>
<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>
xa-transaction-manager-type
in conf/server.yaml
:- !TRANSACTION
defaultType: XA
providerType: Bitronix
Since we have not packed the BASE implementation jar into ShardingSphere-Proxy, you should copy relevant jar which implement ShardingSphereTransactionManager
SPI to conf/lib
, then switch the transaction type to BASE
.