开发者

How to set default commit for transactions in google app engine?

开发者 https://www.devze.com 2023-02-01 10:06 出处:网络
ObjectifyBookShelfDAO transactionalDao = new ObjectifyBookShelfDAO(true); transactionDao.removeThis(item);
ObjectifyBookShelfDAO transactionalDao = new ObjectifyBookShelfDAO(true);  
transactionDao.removeThis(item);   
// Its get removed开发者_JAVA百科 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 ..


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消