最近研究了下google的app engine,在删除一个对象时,遇到了如题的异常。在网上找了下,大都是国外的家伙在论坛里讨论。看了好久,终于找到解决方案。
关键就是删除的对象一定是要通过PersistenceManager的getObjectById()方法获取到的。(有谁知道原因的,告诉我一下)
如果还不清楚,看下面的代码:
PersistenceManager manager = Factory.get().getPersistenceManager();
manager.deletePersistent( manager.getObjectById( entity.getClass(),
entity.getId() ) );
本Blog文章除特别声明之外皆为原创文章,欢迎转载,转载请注明: 转载自JSSAY'S BLOG
本文链接地址: http://www.jssay.com/blog/index.php/2010/04/25/transient-instances-cant-be-deleted/
Great information! I’ve been looking for something like this for a while now. Thanks!
Keep posting stuff like this i really like it
MAmNKa <a href="http://apminrppubuz.com/" rel="nofollow">apminrppubuz</a>, [url=http://wibbkjtcbwxs.com/]wibbkjtcbwxs[/url], [link=http://wdctvkssbuhn.com/]wdctvkssbuhn[/link], http://tqyaqgclzeit.com/
Valuable info. Lucky me I found your site by accident, I bookmarked it.
found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later
Valuable info. Lucky me I found your site by accident, I bookmarked it.
Wow this is a great resource.. I’m enjoying it.. good article
hello, this my first post. dsfcsvcbyjyui
<a href="http://google.com" rel="nofollow">cxzc</a>
http://sdfsd.com
Great articles & Nice a site….