From cff37a0a52cb19fe05c39ec5dbdc7ddabbc3fe12 Mon Sep 17 00:00:00 2001 From: shukai Date: Fri, 17 Oct 2025 18:53:19 +0800 Subject: [PATCH 1/3] bugfix:fix https://github.com/apache/incubator-seata/issues/7690 --- .../apache/seata/rm/datasource/xa/ConnectionProxyXA.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/ConnectionProxyXA.java b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/ConnectionProxyXA.java index ff7f5b3294f..6c2c670e979 100644 --- a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/ConnectionProxyXA.java +++ b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/ConnectionProxyXA.java @@ -56,8 +56,6 @@ public class ConnectionProxyXA extends AbstractConnectionProxyXA implements Hold private volatile boolean xaActive = false; - private volatile boolean xaEnded = false; - private volatile boolean kept = false; private volatile boolean rollBacked = false; @@ -119,9 +117,9 @@ private void releaseIfNecessary() { } private void xaEnd(XAXid xaXid, int flags) throws XAException { - if (!xaEnded) { + if (xaActive) { xaResource.end(xaXid, flags); - xaEnded = true; + xaActive = false; } } @@ -302,7 +300,6 @@ private synchronized void end(int flags) throws XAException, SQLException { } private void cleanXABranchContext() { - xaEnded = false; branchRegisterTime = null; prepareTime = null; xaActive = false; From ce2dfed3671080440514c053f843a203d42f99d3 Mon Sep 17 00:00:00 2001 From: shukai Date: Mon, 20 Oct 2025 17:14:55 +0800 Subject: [PATCH 2/3] add:registered PR --- changes/en-us/2.x.md | 1 + changes/zh-cn/2.x.md | 1 + 2 files changed, 2 insertions(+) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index ecbabfb7b75..9cd57fbea5d 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -46,6 +46,7 @@ Add changes here for all PR submitted to the 2.x branch. - [[#7644](https://github.com/apache/incubator-seata/pull/7644)] fix the compatibility issue of spotless when java 25 - [[#7662](https://github.com/apache/incubator-seata/pull/7662)] ensure visibility of rm and The methods in MockTest are executed in order - [[#7683](https://github.com/apache/incubator-seata/pull/7683)] Override XABranchXid equals() and hashCode() to fix memory leak in mysql driver +- [[#7708](https://github.com/apache/incubator-seata/pull/7708)] Use xaActive to determine whether xaResource needs to execute the end method ### optimize: diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index dc6c1a84599..ac6d8547b70 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -46,6 +46,7 @@ - [[#7644](https://github.com/apache/incubator-seata/pull/7644)] 修复JAVA25时spotless的兼容性问题 - [[#7662](https://github.com/apache/incubator-seata/pull/7662)] 确保 rm 的可见性,并且 MockTest 中的方法按顺序执行 - [[#7683](https://github.com/apache/incubator-seata/pull/7683)] 重写 XABranchXid的equals和hashCode,解决mysql driver内存泄漏问题 +- [[#7708](https://github.com/apache/incubator-seata/pull/7708)] 使用xaActive判断xaResource是否需要执行end方法 ### optimize: From ae3d2e1e29bcfec81464869ecc8db2558c95ccff Mon Sep 17 00:00:00 2001 From: shukai Date: Mon, 20 Oct 2025 17:30:45 +0800 Subject: [PATCH 3/3] add:add GitHub ID --- changes/en-us/2.x.md | 1 + changes/zh-cn/2.x.md | 1 + 2 files changed, 2 insertions(+) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index 4311c6268bd..5763b7618bd 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -127,5 +127,6 @@ Thanks to these contributors for their code commits. Please report an unintended - [dsomehan](https://github.com/dsomehan) - [LegendPei](https://github.com/LegendPei) - [lokidundun](https://github.com/lokidundun) +- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0) Also, we receive many valuable issues, questions and advices from our community. Thanks for you all. diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index 173e7a7805e..79028954b0d 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -124,6 +124,7 @@ - [dsomehan](https://github.com/dsomehan) - [LegendPei](https://github.com/LegendPei) - [lokidundun](https://github.com/lokidundun) +- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0) 同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。