问题
ObjectifyBookShelfDAO transactionalDao = new ObjectifyBookShelfDAO(true);
transactionDao.removeThis(item);
// Its get removed only after i commit
// Perform some operations
transactionDao.ofy().getTxn().commit();
There is a scenario where in i want this object to be removed on instant... How do i do this ..
回答1:
it looks like you're using objectify-appengine. as the objectify transaction docs describe, if you make your call to removeThis()
outside of a transaction, it will happen immediately.
as an alternative, objectify lets you mix in calls to the built in low level java datastore API. you could use that and call DatastoreService.delete() without passing a transaction.
来源:https://stackoverflow.com/questions/4516487/how-to-set-default-commit-for-transactions-in-google-app-engine