There are often times in the middle of a transaction when you would like to make a datastore request outside of a transaction. Perhaps you wish to make a query without an ancestor(), or perhaps you wish to load an entity without enlisting it in a XG transaction.
Objectify makes it easy to run operations outside of a transaction:
ofy().transact(new VoidWork() {
public void vrun() {
Thing thing = ofy().load().key(thingKey).get();
Other other = ofy().transactionless().load().key(thing.otherKey).now();
if (other.specialState) {
thing.modify();
ofy().save().entity(thing);
}
}
});
This circumstance doesn't come up often but it does come up.
.......
--
You received this message because you are subscribed to the Google Groups "twig-persist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to twig-persist...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.