codingapi / codingapi/tx-lcn

tcc事务不生效

Offen
#403 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
4.2k
Forks
1.4k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.