Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: rollback active xa connection fail #5131

Merged
merged 6 commits into from Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/en-us/develop.md
Expand Up @@ -41,6 +41,7 @@ Add changes here for all PR submitted to the develop branch.
- [[#5093](https://github.com/seata/seata/pull/5093)] fix access key loss after seata server restart
- [[#5092](https://github.com/seata/seata/pull/5092)] fix when seata and jpa are used together, their AutoConfiguration order is incorrect
- [[#5109](https://github.com/seata/seata/pull/5109)] fix NPE caused when there is no @GlobalTransactional annotation on the RM side
- [[#5131](https://github.com/seata/seata/pull/5131)] rollback active xa connection fail


### optimize:
Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/develop.md
Expand Up @@ -42,6 +42,7 @@
- [[#5093](https://github.com/seata/seata/pull/5093)] 修复seata server重启后access key丢失问题
- [[#5092](https://github.com/seata/seata/pull/5092)] 修复当seata and jpa共同使用时, AutoConfiguration的顺序不正确的问题
- [[#5109](https://github.com/seata/seata/pull/5109)] 修复当RM侧没有加@GlobalTransactional报NPE的问题
- [[#5131](https://github.com/seata/seata/pull/5131)] 修复xaconnection处于active状态时无法回滚的问题

### optimize:
- [[#4681](https://github.com/seata/seata/pull/4681)] 优化竞争锁过程
Expand Down
Expand Up @@ -132,7 +132,6 @@ public synchronized void xaCommit(String xid, long branchId, String applicationD
* @param xid global transaction xid
* @param branchId transaction branch id
* @param applicationData application data
* @throws SQLException SQLException
*/
public synchronized void xaRollback(String xid, long branchId, String applicationData) throws XAException {
XAXid xaXid = XAXidBuilder.build(xid, branchId);
Expand Down Expand Up @@ -209,6 +208,7 @@ public synchronized void commit() throws SQLException {
throw new SQLException("should NOT commit on an inactive session", SQLSTATE_XA_NOT_END);
}
try {
// XA End: Success
end(XAResource.TMSUCCESS);
long now = System.currentTimeMillis();
checkTimeout(now);
Expand Down Expand Up @@ -277,9 +277,8 @@ private synchronized void start() throws XAException, SQLException {
}

private synchronized void end(int flags) throws XAException, SQLException {
termination();
// XA End: Success
xaResource.end(xaBranchXid, flags);
termination();
}

private void cleanXABranchContext() {
Expand Down