There is no "root-entity group". When parent=None, every entity is its own group. So you are mis-reading the docs, based on an erroneous assumption.
http://code.google.com/appengine/docs/java/datastore/entities.html says "An entity created without a parent is a root entity. A root entity without any children is an entity group by itself." Yes, setting the parent is just a grab for stronger consistency, although it's not really that strong, since queries will still return only "eventually consistent" results. The documentation of this is very bad, as is the documentation of transactions. The pattern I've seen both in HR and in Transactions is: 1) Give an example which is easy to understand, but is a complete anti-pattern. Something you should NEVER do. 2) Put a footnote below the example, saying it's an anti-pattern. These sections of documentation should be "taken out back and shot." These are complicated problems, and we'd really like to see correct examples. The documentation of transactions should create child entities for idempotence, and use task queues to deal with exceptions. The documentation of HR should include real-world examples where entity groups are really needed for transactional consistency, and should include an example of using memcache to provide apparent consistency atop the queries. (Or, put more simply, have whoever wrote the sharded counter example write these examples. 'cause that person knows how to write great examples.) -Joshua On Aug 5, 2011, at 11:51 AM, Kenneth wrote: > Under usage notes at the bottom: > The High Replication code sample above writes to a single entity group per > guestbook. This allows queries on a single guestbook to be strongly > consistent, but also limits changes to the guestbook to 1 write per second > (the supported limit for entity groups). Therefore, writing to a single > entity group per guestbook is not ideal when high usage is expected. If your > app is likely to encounter heavy write usage, consider using another means. > For example, you can put recent posts in memcache with an expiration, and > then display a of mix recent posts from memcache and posts retrieved from the > datastore. > I assumed that the root-entity group isn't special, they seem to be going out > of their way to not use parent=None, is that just a grab for strong > consistency? > > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-appengine/-/a4o19jM0nU4J. > 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. -- 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.
