0
我刚刚注意到XG交易的docs' example使用put方法,它包含交易作为参数,但没有提到这样做的必要性。GAE:是否需要使用交易作为参数调用并获取交叉组交易(XG)?
TransactionOptions options = TransactionOptions.Builder.withXG(true);
Transaction txn = datastore.beginTransaction(options);
Entity a = new Entity("A");
a.setProperty("a", 22);
datastore.put(txn, a);
Entity b = new Entity("B");
b.setProperty("b", 11);
datastore.put(txn, b);
txn.commit();
按照API单个参数(和获取)使用事务:
如果有当前事务,该操作将在 执行该交易
我担心XG交易。如果我只是在这个例子中使用了两个实体的单个参数(并且我有很多这样的代码),它们是否仍然会在XG事务中执行?