codingapi / codingapi/tx-lcn

tcc事务不生效

Open
#403 1 comment 0 reactions 0 assignees View on GitHub
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

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.