Skip to content

Commit 8844ce9

Browse files
bugfix: the issue where connection held during the first phase of PostgreSQL cannot be rollback (#6825)
1 parent 5fa41c5 commit 8844ce9

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

changes/en-us/2.x.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Add changes here for all PR submitted to the 2.x branch.
3636
- [[#6812](https://github.com/apache/incubator-seata/pull/6812)] bugfix: change group and node offline status are not pushed in real time
3737
- [[#6817](https://github.com/apache/incubator-seata/pull/6817)] bugfix: fix namingserver changVgroup failed
3838
- [[#6820](https://github.com/apache/incubator-seata/pull/6820)] Fix file path error in the Dockerfile
39-
39+
- [[#6825](https://github.com/apache/incubator-seata/pull/6825)] Fix the issue of XA mode transaction timeout and inability to roll back in Postgres
4040

4141

4242
### optimize:
@@ -134,5 +134,6 @@ Thanks to these contributors for their code commits. Please report an unintended
134134
- [l81893521](https://github.com/l81893521)
135135
- [laywin](https://github.com/laywin)
136136
- [xingfudeshi](https://github.com/xingfudeshi)
137+
- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0)
137138

138139
Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.

changes/zh-cn/2.x.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- [[#6759](https://github.com/apache/incubator-seata/pull/6759)] 修复跨库表主动刷新`tableMeta`的异常问题
3838
- [[#6817](https://github.com/apache/incubator-seata/pull/6817)] 修复namingserver切换事务分组失效的问题
3939
- [[#6820](https://github.com/apache/incubator-seata/pull/6820)] 修复Dockerfile得文件结构错误
40+
- [[#6825](https://github.com/apache/incubator-seata/pull/6825)] 修复Postgres的XA模式事务超时无法回滚问题
4041
-
4142
### optimize:
4243
- [[#6499](https://github.com/apache/incubator-seata/pull/6499)] 拆分 committing 和 rollbacking 状态的任务线程池
@@ -134,6 +135,7 @@
134135
- [l81893521](https://github.com/l81893521)
135136
- [laywin](https://github.com/laywin)
136137
- [xingfudeshi](https://github.com/xingfudeshi)
138+
- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0)
137139

138140
同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
139141

rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/ConnectionProxyXA.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,12 @@ public synchronized void xaCommit(String xid, long branchId, String applicationD
140140
* @param applicationData application data
141141
*/
142142
public synchronized void xaRollback(String xid, long branchId, String applicationData) throws XAException {
143-
XAXid xaXid = XAXidBuilder.build(xid, branchId);
144-
xaRollback(xaXid);
143+
if (this.xaBranchXid != null) {
144+
xaRollback(xaBranchXid);
145+
} else {
146+
XAXid xaXid = XAXidBuilder.build(xid, branchId);
147+
xaRollback(xaXid);
148+
}
145149
}
146150

147151
/**

0 commit comments

Comments
 (0)