tcc事务不生效
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
- [x] I have searched the [issues](https://github.com/codingapi/tx-lcn/issues) of this repository and believe that this is not a duplicate.
### 1. Bug Description
业务方法正常执行出现异常,cancel方法不能被调用
### 2. Environment:
- JDK version:1.8
- OS:window10
- TX-LCN version:5.0.2
- Others:
### 3. Exception Stacktrace
```
Paste your Exception Stacktrace here!
```
### 4. Tour Idea
@TccTransaction(cancelMethod = "cancelRpc",confirmMethod = "confirmRpc",propagation = DTXPropagation.SUPPORTS)
@Transactional
@Override
public String tccTransfer(String user, Integer money) {
// 增加对方金额
String res = bankBClient.tccAddMoney(user, money);
// 构建用户信息
User u = new User(user, Double.valueOf(money));
ids.put(TracingContext.tracing().groupId(), u);
if ("done".equals(res)) {
// 出现异常
throw new RuntimeException("transfer fail ...");
}
return "fail";
}
public void confirmRpc(String user, Integer money) {
log.info("-----------:tcc confirm阶段");
}
public void cancelRpc(String username, Integer money) {
log.info("-----------:tcc cancel阶段");
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the reported tccTransfer example with TX-LCN 5.0.2, focusing on the interaction between @TccTransaction, @Transactional, and DTXPropagation.SUPPORTS. Trace whether the RuntimeException reaches the transaction coordinator and whether cancelRpc is registered and invoked; done means the cancel phase calls cancelRpc for the failing transfer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100