【Sharding-JDBC】分布式事务

分布式事务相关概念和更多详细的介绍,请看:

https://shardingsphere.apache.org/document/legacy/4.x/document/cn/features/transaction/

一、不使用Spring

① 引入maven依赖

<dependency>
    <groupId>org.apache.shardingsphere</groupId>
    <artifactId>sharding-jdbc-core</artifactId>
    <version>4.1.1</version>
</dependency>

<!-- 使用XA事务时,需要引入此模块 -->
<dependency>
    <groupId>org.apache.shardingsphere</groupId>
    <artifactId>sharding-transaction-xa-core</artifactId>
    <version>4.1.1</version>
</dependency>

<!-- 使用BASE事务时,需要引入此模块 -->
<dependency>
    <groupId>org.apache.shardingsphere</groupId>
    <artifactId>sharding-transaction-base-seata-at</artifactId>
    <version>4.1.1</version>
</dependency>

② 基于Java编码方式使用分布式事务

# 配置数据源

 

#

 

posted @ 2020-10-18 15:07  codedot  阅读(1255)  评论(1编辑  收藏  举报