Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 使用JDO/Google应用程序引擎在哪里设置TransactionOptions?_Google App Engine_Persistence_Jdo - Fatal编程技术网

Google app engine 使用JDO/Google应用程序引擎在哪里设置TransactionOptions?

Google app engine 使用JDO/Google应用程序引擎在哪里设置TransactionOptions?,google-app-engine,persistence,jdo,Google App Engine,Persistence,Jdo,我在GAE中使用JDO使用以下方法批处理持久化对象: public void makePersistent(PersistenceManager pm, List<Regeling> makePersistent) { Transaction tx = pm.currentTransaction(); try { // Start the transaction tx.begin();

我在GAE中使用JDO使用以下方法批处理持久化对象:

public void makePersistent(PersistenceManager pm,
        List<Regeling> makePersistent) {        
    Transaction tx = pm.currentTransaction(); 
    try {
        // Start the transaction
        tx.begin();
        // Persist to the datastore
        // pm.makePersistentAll(makePersistent);
        for (int i = 0; i < makePersistent.size(); i += BATCH_SIZE) {
            int last = i + BATCH_SIZE;
            last = last > makePersistent.size() ? makePersistent.size()
                    : last;
            pm.makePersistentAll(makePersistent.subList(i, last));
            pm.flush();
            System.out.println("Made "+last+" items persistent.");
        }
        // Commit the transaction, flushing the object to the datastore
        tx.commit();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (tx.isActive()) {
            // Error occurred so rollback the transaction
            System.out.println("Rolling back transaction");
            tx.rollback();
        }
        pm.close();
    }
}
因此,我尝试设置以下选项:

TransactionOptions ops = TransactionOptions.Builder.withXG(true);

但是我找不到一个接受
TransactionOptions
对象的方法。在哪里可以设置这些选项?

jdoconfig.xml
中设置:

<property name="datanucleus.appengine.datastoreEnableXGTransactions" value="true" />

想解释一下为什么有人投了否决票吗?
<property name="datanucleus.appengine.datastoreEnableXGTransactions" value="true" />