tcc事务不生效
- Langage dominant
- Java
- Étoiles
- 4.2k
- Forks
- 1.4k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
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阶段");
}
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java, spring
- Domaine
- backend, distributed-systems
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100