feature: Reuse connection to merge branch transactions#7509
feature: Reuse connection to merge branch transactions#7509funky-eyes merged 22 commits intoapache:2.xfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 2.x #7509 +/- ##
============================================
- Coverage 61.37% 61.34% -0.04%
- Complexity 658 662 +4
============================================
Files 1308 1311 +3
Lines 49443 49567 +124
Branches 5811 5834 +23
============================================
+ Hits 30346 30406 +60
- Misses 16390 16440 +50
- Partials 2707 2721 +14
🚀 New features to boost your workflow:
|
|
Please update all comments written in Chinese to English. |
# Conflicts: # changes/en-us/2.x.md # changes/zh-cn/2.x.md
done
done |
integration-tx-api/pom.xml
Outdated
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.springframework</groupId> |
There was a problem hiding this comment.
It should not rely on Spring, but instead refer to the existing proxy approach and use byte-buddy for proxying.
# Conflicts: # changes/en-us/2.x.md # changes/zh-cn/2.x.md
...che/seata/integration/tx/api/interceptor/handler/CombineTransactionalInterceptorHandler.java
Show resolved
Hide resolved
integration-tx-api/src/main/java/org/apache/seata/spring/annotation/CombineTransactional.java
Outdated
Show resolved
Hide resolved
integration-tx-api/src/main/java/org/apache/seata/spring/annotation/CombineTransactional.java
Show resolved
Hide resolved
rm-datasource/src/main/java/org/apache/seata/rm/datasource/combine/CombineContext.java
Outdated
Show resolved
Hide resolved
...che/seata/integration/tx/api/interceptor/handler/CombineTransactionalInterceptorHandler.java
Outdated
Show resolved
Hide resolved
...che/seata/integration/tx/api/interceptor/handler/CombineTransactionalInterceptorHandler.java
Outdated
Show resolved
Hide resolved
| import java.util.concurrent.ConcurrentHashMap; | ||
|
|
||
| public class CombineConnectionHolder { | ||
| private static final ThreadLocal<Map<String, Map<Object, ConnectionProxyXA>>> CONNECTION_HOLDER = |
There was a problem hiding this comment.
Why use ConcurrentHashMap? Will there be concurrent situations?
There was a problem hiding this comment.
I think there may be asynchronous or parallel branches.
rm-datasource/src/main/java/org/apache/seata/rm/datasource/combine/CombineConnectionHolder.java
Show resolved
Hide resolved
|
|
||
| @Override | ||
| public void rollback() throws SQLException { | ||
| if (combine) { |
There was a problem hiding this comment.
If a rollback is issued during a two-phase commit, would there be any issues if the branch is still running?
There was a problem hiding this comment.
There may be a situation where the connection is not reset and the process is automatically submitted. This has been resolved
| * @throws XAException XAException | ||
| */ | ||
| public void xaRollback(XAXid xaXid) throws XAException { | ||
| xaEnd(xaXid, XAResource.TMFAIL); |
There was a problem hiding this comment.
Hi! Can you explain a bit why this xaEnd() is added?
I'm experiencing issues with this line ending a MySQL branch, where the DB throws an exception saying that end is not allowed when the branch is in a NON-EXISTING state.
Without this line, everything works just fine since Seata 2.0.0.
Ⅰ. Describe what this PR did
fixes #7357
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews