Distributed Transaction
Background
ShardingSphere provides three modes for distributed transactions LOCAL
, XA
, BASE
.
Parameters
transaction:
defaultType: # Transaction mode, optional value LOCAL/XA/BASE
providerType: # Specific implementation of the mode
Procedure
Use LOCAL Mode
The content of the server.yaml configuration file is as follows:
transaction:
defaultType: LOCAL
Use XA Mode
The content of the server.yaml configuration file is as follows:
transaction:
defaultType: XA
providerType: Narayana/Atomikos
To manually add Narayana-related dependencies:
jta-5.12.4.Final.jar
arjuna-5.12.4.Final.jar
common-5.12.4.Final.jar
jboss-connector-api_1.7_spec-1.0.0.Final.jar
jboss-logging-3.2.1.Final.jar
jboss-transaction-api_1.2_spec-1.0.0.Alpha3.jar
jboss-transaction-spi-7.6.0.Final.jar
narayana-jts-integration-5.12.4.Final.jar
shardingsphere-transaction-xa-narayana-x.x.x-SNAPSHOT.jar
Use BASE Mode
The content of the server.yaml configuration file is as follows:
transaction:
defaultType: BASE
providerType: Seata
Build a Seata Server, add relevant configuration files and Seata dependencies, see ShardingSphere Integrates Seata Flexible Transactions
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .