codingapi / codingapi/tx-lcn

tcc事务不生效

未关闭
#403 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
4.2k
派生
1.4k
PR 合并指标
30 天内没有已合并 PR

描述

- [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阶段");
}

贡献指南

这个仓库没有索引到贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
java, spring
领域
backend, distributed-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。