Appengine 事务锁
我想确保关于 GAE 的交易锁定的一件事。在文档中它说:
事务中的所有数据存储操作都必须对以下实体进行操作 如果交易是单个组,则为同一实体组 交易,....
因此,当 txn 运行时,它将仅锁定该单个实体组的每个条目,而不会锁定事务中使用的模型的每个条目。对吗?
I want make sure that one thing about the transaction lock of GAE. In the documentation it said:
All datastore operations in a transaction must operate on entities in
the same entity group if the transaction is a single group
transaction, ....
So while a txn is running, it will lock only every entries of that single entity group, won't lock every entry of models which are used in the transaction. Is it right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GAE 使用乐观锁定 - 这意味着事务中没有锁定任何内容,而是检查上次更新时间,如果在您开始事务之后 - 它会抛出异常(并回滚您的数据)。其描述见“事务中可以执行的操作”
GAE uses optimistic locking - that means that nothing is locked in transaction, instead it check last update time, and if it's after time you have started your transactions - it will throw exceptions (and rollback your data). It's described at 'What Can Be Done In a Transaction'