codingapi / codingapi/tx-lcn

tcc事务不生效

Đang mở
#403 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
4.2k
Fork
1.4k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, spring
Lĩnh vực
backend, distributed-systems
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.