2

It is not clear for me, from the documentation, which ancestor is a boundary for a transaction. The closest one, or the root one?

I have a root entity (A) and it has a few descendants (B1, B2 ... Bn) and those can have many ancestors (C1, C2...). I will make transactions on the C entities (Cs), which I will get with an ancestor query based on a B entity. Question is, will a change in Cs under B1 throw a ConcurrentModificationException if another transaction changes some Cs under a B2 in the same time?

Do all the Cs belong to the same entity group under their grandparent A or are the entity groups also divided in smaller "sub - entity groups" i.e. every group of Cs under a B has their own entity group?

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
shelll
  • 3,234
  • 3
  • 33
  • 67

1 Answers1

1

The boundary is the root.

From https://developers.google.com/appengine/docs/python/datastore/transactions:

All Datastore operations in a transaction must operate on entities in the same entity group

and

each root entity belongs to a separate entity group, so a single transaction cannot create or operate on more than one root entity

So everything under A is one entity group.

ckhan
  • 4,771
  • 24
  • 26
  • documentation also says `An entity's parent, parent's parent, and so on recursively, are its ancestors; its children, children's children, and so on, are its descendants. An entity and its descendants are said to belong to the same entity group.` Last sentence can mean, that that all Bs can form its own entity groups, which belong to an entity group set by an A. I understand that the whole entity group is the "A", but is there support for something like nested entity groups? Hmm, probably not and there is only the one entity group, the "A"... – shelll May 09 '13 at 19:52