You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by hu...@apache.org on 2026/08/14 01:45:56 UTC
(shardingsphere) branch master updated: Correct JDBC transaction Java API dependencies (#39443)
This is an automated email from the ASF dual-hosted git repository.
iamhucong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new d29fe774d9c Correct JDBC transaction Java API dependencies (#39443)
d29fe774d9c is described below
commit d29fe774d9c805ff1afffdcf8de7348c9925661c
Author: ZhangCheng <ch...@apache.org>
AuthorDate: Fri Aug 14 09:45:50 2026 +0800
Correct JDBC transaction Java API dependencies (#39443)
---
.../special-api/transaction/java-api.cn.md | 36 +++++++++++++++++-----
.../special-api/transaction/java-api.en.md | 36 +++++++++++++++++-----
2 files changed, 58 insertions(+), 14 deletions(-)
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/java-api.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/java-api.cn.md
index 3168a4bc38f..76db7d53878 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/java-api.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/java-api.cn.md
@@ -9,7 +9,7 @@ weight = 1
## 前提条件
-引入 Maven 依赖
+引入 ShardingSphere-JDBC Maven 依赖:
```xml
<dependency>
@@ -17,27 +17,49 @@ weight = 1
<artifactId>shardingsphere-jdbc</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
+```
+
+使用 XA 事务时,`shardingsphere-jdbc` 已传递依赖 XA 核心模块;还需要根据 `providerType` 选择一个 XA provider。
-<!-- 使用 XA 事务时,需要引入此模块 -->
+使用 Narayana:
+
+```xml
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-transaction-xa-core</artifactId>
+ <artifactId>shardingsphere-transaction-xa-narayana</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
+```
-<!-- 使用 XA 的 Narayana 模式时,需要引入此模块 -->
+使用 Atomikos:
+
+```xml
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-transaction-xa-narayana</artifactId>
- <version>${project.version}</version>
+ <artifactId>shardingsphere-transaction-xa-atomikos</artifactId>
+ <version>${shardingsphere.version}</version>
</dependency>
+```
+
+使用 BASE 事务时,需要同时引入 ShardingSphere Seata AT 集成模块和 Seata Client:
-<!-- 使用 BASE 事务时,需要引入此模块 -->
+```xml
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-base-seata-at</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
+<dependency>
+ <groupId>org.apache.seata</groupId>
+ <artifactId>seata-all</artifactId>
+ <version>2.6.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr4-runtime</artifactId>
+ </exclusion>
+ </exclusions>
+</dependency>
```
## 操作步骤
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/java-api.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/java-api.en.md
index f25e2fa2c88..d7916190039 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/java-api.en.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/java-api.en.md
@@ -9,7 +9,7 @@ With ShardingSphere-JDBC, XA and BASE mode transactions can be used through the
## Prerequisites
-Introducing Maven dependency
+Add the ShardingSphere-JDBC Maven dependency:
```xml
<dependency>
@@ -17,27 +17,49 @@ Introducing Maven dependency
<artifactId>shardingsphere-jdbc</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
+```
+
+When using XA transactions, `shardingsphere-jdbc` already includes the XA core module as a transitive dependency. Add one XA provider that matches `providerType`.
-<!-- This module is required when using XA transactions -->
+For Narayana:
+
+```xml
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-transaction-xa-core</artifactId>
+ <artifactId>shardingsphere-transaction-xa-narayana</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
+```
-<!-- This module is required when using the Narayana mode with XA transactions -->
+For Atomikos:
+
+```xml
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-transaction-xa-narayana</artifactId>
- <version>${project.version}</version>
+ <artifactId>shardingsphere-transaction-xa-atomikos</artifactId>
+ <version>${shardingsphere.version}</version>
</dependency>
+```
+
+When using BASE transactions, add both the ShardingSphere Seata AT integration module and Seata Client:
-<!-- This module is required when using BASE transactions -->
+```xml
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-base-seata-at</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
+<dependency>
+ <groupId>org.apache.seata</groupId>
+ <artifactId>seata-all</artifactId>
+ <version>2.6.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr4-runtime</artifactId>
+ </exclusion>
+ </exclusions>
+</dependency>
```
## Procedure