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" <[email protected]> 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
