>From the documentation:

While an app is applying changes to entities in an entity group, all other
attempts to update any entity in the group fail at commit time. Because of
this design, using entity groups limits the number of concurrent writes you
can do on any entity in that group. When a transaction starts, App Engine
uses optimistic concurrency
control<http://en.wikipedia.org/wiki/Optimistic_concurrency_control>by
checking the last update time for the entity group. Upon commiting a
transaction for an entity group, App Engine again checks the last update
time for the entity group. If it has changed since our initial check, we
throw an exception. For an explanation of entity groups, see Entity
Groups<http://code.google.com/appengine/docs/java/datastore/transactions.html#Entity_Groups>
.



On Thu, Jan 13, 2011 at 10:48 AM, Mark <mar...@gmail.com> wrote:

> Hi,
>
> Let's say we have an entity group hierarchy like this:
>
>    Foo
>       |
>       --- Grok
>
> Foo is the entity parent. Any time I add a Grok instance to the
> datastore, does the parent Foo instance have to be locked? Example:
>
>    Transaction tx = pm.currentTransaction();
>    try {
>        tx.begin();
>
>        Grok grok = new Grok();
>        pm.makePersistent(grok);
>
>        tx.commit(); // will a parent Foo get locked now?
>    }
>    finally {
>        if (tx.isActive()) {
>            tx.rollback();
>    }
>
> I guess the same question then - if I'm performing a transaction on
> the parent Foo, will all its Grok instances be locked?
>
> 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 google-appengine@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com<google-appengine%2bunsubscr...@googlegroups.com>
> .
> 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 google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to