Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCC各阶段对应操作是否不合理? #35

Closed
xqxyxchy opened this issue Aug 29, 2018 · 2 comments
Closed

TCC各阶段对应操作是否不合理? #35

xqxyxchy opened this issue Aug 29, 2018 · 2 comments
Labels

Comments

@xqxyxchy
Copy link
Contributor

T-Try预留资源,demo中对应是锁库存、冻结资金;
C-Confirm确认执行业务,demo中是减库存、减资金--真正的业务方法(即添加TCC注解的方法才是业务);
C-Cancel业务回滚,demo中是解锁库存、解冻资金;

但在框架中对应却不是这样的,真正的业务在框架处理时对应的是T-Try操作;
hmily

是我理解错误么?
求解惑。

@yu199195
Copy link
Member

看代码,下面不是有confrim吗

@xqxyxchy
Copy link
Contributor Author

我的疑惑不是有没有confirm。
而是真正的业务不是应该在confirm里面执行么?上面代码却是在try里面执行的。
是我理解错了,还是try和confirm可以反过来?try执行业务、confirm执行锁资源。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants