-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
transfer-tcc-sample 子项目中 冻结金额的操作是不是多余的 #615
Comments
想想不冻结如果再来一个扣款会发生什么?如果要回滚又如何回滚?要回滚多少金额?用户看到账户的金额又是多少? |
你好,
这里应该是
|
分布式事务有哪些书籍可以推荐呀或者开源项目做做参考 |
你的逻辑是对的。 |
不冻结的话,可能存在超出余额的转账事务存在。比如余额是100,A事务转50,B事务转100,这个时候B事务只会看到余额有100,不清楚其他事务是否也在转账中。加上第二阶段又必须成功,会导致两笔都成功。 |
你没理解冻结的概念,冻结的意思是这部分钱被某个事务占用了,并且已经从余额里扣除了,就不用再参与其他事务的计算了。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这段代码中对FreezedAmount的操作有何意义?
The text was updated successfully, but these errors were encountered: