According to the documentation, it's also possible (though very
unlikely) that App Engine will execute the enqueued task multiple
times, this is something you may need to consider when implementing
your balancing/reconciliation tasks.

Tom.

On 20 January 2011 18:07, Didier Durand <durand.did...@gmail.com> wrote:
> Hi,
>
> The usual way is to launch a task included in the 1st transaction for
> the second update.
>
> See 
> http://code.google.com/appengine/docs/java/taskqueue/overview.html#Tasks_Within_Transactions
>
> You have the guarantee that the task is enqueued only if the 1st
> update succeeds. What is not guaranteed though is a rollback on the
> 1st update if the second fails or can't happen. You have to manage
> this case by yourself probably via a 3rd task that you schedule when
> the second fails.
>
> regards
>
> didier
>
> On Jan 20, 6:58 pm, "ss.require" <ss.requ...@gmail.com> wrote:
>> I have the next problem:
>> My app has thousands of users. Every user has money that can be
>> represented as the "money" field in the "User" entity. If a payable
>> event occurs in the app then I have to make a payment between two
>> users so I need to update "money" fields for two "User" entities in a
>> transaction. But I can't do it in a transaction because each user is
>> in a different entity group and on the other hand I cann't put two
>> users in a single entity group, because thus the single entity group
>> will have all users and datastore contention problem will arise.
>>
>> I can't figure out how this use case can be implemented correctly or
>> how to design a datastore model.
>> Please, suggest best practices for this situation!
>
> --
> 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.

Reply via email to