In your example you would have two entity groups: *Group 1: *Person: 1 Aravind Car: Ford #258
*Group 2: *Person: 2 Hari Car: Maruti #456 Car: Mercedes #456 When you create the Car entities, specify their parent as the Person entity that owns them. This is what places them in the same entity group. It is not necessary for the Car to have a explicit reference to the Person -- this can be handled with the Key alone. Now, if Aravind updates his car info, only Entity Group 1 will be "locked" and this will scale well since your entity groups are limited to one user's worth of data. -Chris On Fri, Dec 3, 2010 at 1:29 PM, har_shan <[email protected]> wrote: > Am learning GAE and got a bit confused on this. > Lets say i have a sample model > > Person (parent) {id, name, List<Car>} > Car {make, model, Person} > > (1 - m relationship) say > > So both are in same entity groups (lets say i want to transact them > together). > > Sample data: > Person: ID NAME > 1 Aravind > 2 Hari > > Car > MAKE MODEL > Ford #258 {Aravind} > Maruti #456 {Hari} > Mercedes #456 {Hari} > > According to http://code.google.com/appengine/articles/scaling/contention.html > 'Keep entity groups small' and also read in other places, > i see that when you update a entity in an entity group in a > transaction, entity group is locked, so when other process tries > updating same entity group it fails/aborts. > > So my doubt is, does this mean that if Aravind updates his Car data, > then Hari can't update his Car data at the same time, since both > entities fall under same entity group (and hence it has to be retried > to get it passed). > (if above is true, does it mean that when above update is done > concurrently by say 1K users then most of them would fail!) > > or i just understood it wrongly > and does this apply only to each individual's data i.e. in above e.g. > another process just can't update Aravind's Car data (when Aravind is > actually updating Car data) > but CAN update Hari's Car data (and hence other's Car data). > > Thanks, > > -- > You received this message because you are subscribed to the Google Groups "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to [email protected]<google-appengine%[email protected]> . > For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" 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?hl=en.
