【问题标题】:Writing to the datastore without closing Persistence Manager在不关闭 Persistence Manager 的情况下写入数据存储
【发布时间】:2015-03-29 07:51:13
【问题描述】:

如何在使用 PersistenceManager 更新对象而不关闭它时提交到数据库?

【问题讨论】:

  • 为什么不显示你当前正在做的事情的代码,特别是你的交易在哪里(假设你有一个)?

标签: java google-cloud-datastore jdo persistence-manager


【解决方案1】:

您需要提交事务。您无需关闭 PersistenceManager。

PersistenceManager p;
...
p.currentTransaction().begin();
.... //do the work
p.currentTransaction().commit();

【讨论】:

    猜你喜欢
    • 2013-02-08
    • 2021-08-07
    • 2012-08-19
    • 2011-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-31
    • 2010-09-26
    相关资源
    最近更新 更多