知识卡片
显式事务参数决定操作归属
Java低级API可把Transaction传给get/put/delete;传null则使该操作在事务外立即执行,即使存在当前事务。当前事务栈只影响未显式指定的调用,多个事务对象也不自动构成嵌套原子事务。审查时逐个确认数据操作的归属,避免以为整段代码都被一个commit保护。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第6章 数据存储区事务 Java中的事务 · 连续片段1 · 查看原书依据
Update entityTwo immediately, outside of the transaction. ds.put(null, entityTwo); //Commit the transaction, updating entityOne. txn.commit(
参考来源
- 位置:《GAE编程指南》第06章《Java中的事务 · 连续片段1》(来源项目book-sources;源文件:extracted/OReilly精品图书系列共21册(《Javascript权威指南》、《机器学习:实用案例解析》、《编写可读代码的艺术》、《算法精解》等)/_epub-src/text/part2918.html,spine3009)
- 结论依据:该小节的操作、示例与讨论支持本卡所述机制及条件;具体接口、语法和命令限定于本书2010年的早期Google App Engine环境,迁移到其他版本须另行核验。
- 原始内容:Update entityTwo immediately, outside of the transaction. ds.put(null, entityTwo); //Commit the transaction, updating entityOne. txn.commit(