Hi James, You can check if an entity has a parent by calling Model.parent() which will return the parent, if it exists, or None if no parent exists.
For entity groups, you need to explicit set the parent of the entity when it is created. This is the only time the parent of an entity can be set. Some people have been confused about entity groups and ReferenceProperties, a reference to another property does not indicate the entity and the reference are in the same group - the two concepts are not related. As above, entity groups are only defined by setting the parent. If you post the code you are using when you receive the message, we'd be happy to help you troubleshoot the error. -Marzia On Fri, Sep 26, 2008 at 12:12 AM, Josh Heitzman <[EMAIL PROTECTED]>wrote: > > Your understanding is correct based on my experience. As far as > determining entity group I think you'll just have to examine the > ancestry of each entity in your transaction to see if they actually > have a common instance. > > On Sep 25, 11:33 pm, Jamesz <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > > > I just want to check my general understanding of app engine datastore > > concepts with you guys. > > > > After reading documentations on entity group and transactions, my > > understanding is that entities of different kind can still be in the > > same group provided that they have the same ancestors(parents or > > parents of parents). This means I can perform transactions on entities > > of different kinds. > > > > For clarity, this is my understanding of app engine concepts that > > roughly translates to its RDBMS equivalent > > 1. Kind = Table (this is roughly the case, though entities of the same > > kind doesn't have to have the same fields) > > 2. Property = Field > > 3. Entity = A record > > 4. Parent and Ancestors = no equivalent but is used to group entities > > into a entity group which will be stored in the same nodes which > > enables transactional executions. > > > > But when i applied this in practice, I get an error with "Cannot > > operate on different entity groups in a transaction". So I wonder if > > I've misunderstood something, Is there a way to check what entity > > group an entity actually belongs to? > > > > Thanks > > > > James > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
