Re: [appengine-java] How To: Persist an entity, if and only if, another successfully persists

2011-05-14 Thread Jeff Schnitzer
Depending on your application, you may be able to perform the 2nd
entity write in a task.  Enqueue the task transactionally with the
first operation.  You'll be guaranteed that if the first entity
commits, the 2nd will *eventually* be written as well.

It's not a perfect solution for all apps but it does cover a lot of
practical use cases.

Jeff

On Sat, May 14, 2011 at 7:52 AM, mscwd01  wrote:
> Hey
>
> I have two entities I update and which to persist. These are in two
> different entity groups so I cannot update and persist them within a
> Transaction. I am using JDO pm.makePersistentAll and must ensure each
> entity only saves to the datastore if both can be written.
>
> What's the best way to do this?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] How To: Persist an entity, if and only if, another successfully persists

2011-05-14 Thread mscwd01
Hey

I have two entities I update and which to persist. These are in two
different entity groups so I cannot update and persist them within a
Transaction. I am using JDO pm.makePersistentAll and must ensure each
entity only saves to the datastore if both can be written.

What's the best way to do this?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.