【发布时间】:2014-02-26 14:51:03
【问题描述】:
来自App Engine doc 交易:
Note: In extremely rare cases, the transaction is fully committed even if a transaction
returns a timeout or internal error exception. For this reason, it's best to make transactions
idempotent whenever possible.
假设A给另一个人B转账的情况,操作应该是在一个事务中,如果上面的Note确实发生了,那么它将处于不一致的状态,(转账动作不能是幂等的)。我的理解正确吗?
【问题讨论】:
-
Nick Johnson 阅读和分发事务并前滚事务 - blog.notdot.net/2009/9/Distributed-Transactions-on-App-Engine 示例使用 Python,但将其转换为 Java 应该非常简单。并且值得一读这篇文章之后的所有 cmets,其中涵盖了一些有趣的极端案例。