This is an automated email from the ASF dual-hosted git repository.

maple pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new 5a89e80734 bugfix: shentongdata xa mode should be hold the same 
connection (#7771)
5a89e80734 is described below

commit 5a89e80734ec1a39d6d5215c3d691e6cff02769f
Author: hanshaohua <[email protected]>
AuthorDate: Wed Nov 12 14:42:21 2025 +0800

    bugfix: shentongdata xa mode should be hold the same connection (#7771)
---
 changes/en-us/2.x.md                                              | 1 +
 changes/zh-cn/2.x.md                                              | 1 +
 .../java/org/apache/seata/rm/datasource/xa/DataSourceProxyXA.java | 2 ++
 .../org/apache/seata/rm/datasource/xa/DataSourceProxyXATest.java  | 8 ++++++++
 4 files changed, 12 insertions(+)

diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index f964705dae..79e8737c6c 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -50,6 +50,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7747](https://github.com/apache/incubator-seata/pull/7747)] undo log 
table name dynamic derivation
 - [[#7749](https://github.com/apache/incubator-seata/pull/7749)] fix error 
parsing application/x-www-form-urlencoded requests in Http2HttpHandler
 - [[#7761](https://github.com/apache/incubator-seata/pull/7761)] special 
handling is applied to the Byte[] type to ensure the correct primary key value
+- [[#7771](https://github.com/apache/incubator-seata/pull/7771)] Shentongdata 
xa mode should be hold the same connection
 
 
 ### optimize:
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 93b13cbfe0..8f57b4776f 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -50,6 +50,7 @@
 - [[#7747](https://github.com/apache/incubator-seata/pull/7747)] 
支持undo_log序列名动态推导
 - [[#7749](https://github.com/apache/incubator-seata/pull/7749)] 修复 
Http2HttpHandler 解析 application/x-www-form-urlencoded 请求失败的问题
 - [[#7761](https://github.com/apache/incubator-seata/pull/7761)] 对 Byte[] 
类型进行了特殊处理,以确保主键值正确
+- [[#7771](https://github.com/apache/incubator-seata/pull/7771)] 
确保神通XA模式相同的事务使用相同的XAConnection
 
 
 ### optimize:
diff --git 
a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/DataSourceProxyXA.java
 
b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/DataSourceProxyXA.java
index 38c989359c..0534448566 100644
--- 
a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/DataSourceProxyXA.java
+++ 
b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/DataSourceProxyXA.java
@@ -75,6 +75,8 @@ public class DataSourceProxyXA extends 
AbstractDataSourceProxyXA {
             }
         } else if (DBType.MARIADB.name().equalsIgnoreCase(dbType)) {
             setShouldBeHeld(true);
+        } else if (DBType.OSCAR.name().equalsIgnoreCase(dbType)) {
+            setShouldBeHeld(true);
         }
         
Optional.ofNullable(DefaultResourceManager.get().getResourceManager(BranchType.XA))
                 .ifPresent(resourceManager -> {
diff --git 
a/rm-datasource/src/test/java/org/apache/seata/rm/datasource/xa/DataSourceProxyXATest.java
 
b/rm-datasource/src/test/java/org/apache/seata/rm/datasource/xa/DataSourceProxyXATest.java
index bb9a740c93..c363ff6145 100644
--- 
a/rm-datasource/src/test/java/org/apache/seata/rm/datasource/xa/DataSourceProxyXATest.java
+++ 
b/rm-datasource/src/test/java/org/apache/seata/rm/datasource/xa/DataSourceProxyXATest.java
@@ -23,6 +23,7 @@ import com.mysql.jdbc.JDBC4MySQLConnection;
 import com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper;
 import com.mysql.jdbc.jdbc2.optional.MysqlXAConnection;
 import com.oscar.xa.Jdbc3XAConnection;
+import org.apache.seata.core.constants.DBType;
 import org.apache.seata.core.context.RootContext;
 import org.apache.seata.rm.datasource.combine.CombineConnectionHolder;
 import org.apache.seata.rm.datasource.mock.MockDataSource;
@@ -126,6 +127,13 @@ public class DataSourceProxyXATest {
         druidDataSource.setDriver(driver);
         druidDataSource.setUrl(mockJdbcUrl);
         DataSourceProxyXA dataSourceProxyXA = new 
DataSourceProxyXA(druidDataSource);
+        // Test isShouldBeHeld
+        String dbType = dataSourceProxyXA.getDbType();
+        if (DBType.MYSQL.name().equalsIgnoreCase(dbType)
+                || DBType.MARIADB.name().equalsIgnoreCase(dbType)
+                || DBType.OSCAR.name().equalsIgnoreCase(dbType)) {
+            Assertions.assertTrue(dataSourceProxyXA.isShouldBeHeld());
+        }
         Connection connFromDataSourceProxyXA = 
dataSourceProxyXA.getConnection();
         Assertions.assertFalse(connFromDataSourceProxyXA instanceof 
ConnectionProxyXA);
         RootContext.bind("test");


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to