Is it always necessary to define an entity group in order to use
transactions for multiple entities?
----------------------------------------------------------------------------------------------------
Yes, for two reasons:

1.  An entity's entity group is always defined at creation-time. It is
either a child of another entity and therefore is in that entity's
entity group, or it is not a child of another entity and therefore is
the root entity of its own new entity group.
2.  I believe that a transaction can only involve updating or deleting
entities which belong to the same entity group.


If so, then is it possible to define entity groups specific to the
operation on the entities?
---------------------------------------------------------------------------------------------
No. After an entity's entity group membership has been set at creation-
time it cannot be changed.


If we use numeric keys for unowned relationships, then does it mean
that we cannot use transactions for the same?
--------------------------------------------------------------------------------------
--------------------------
An "unowned relationship" between two entities usually means to me
that they are not in the same entity group. Transactions that update/
delete entities cannot do this for entities in different entity
groups.


On Sep 16, 5:34 am, Barada Sahu <[email protected]> wrote:
> Hi,
>
> 1. Is it always necessary to define an entity group in order to use
> transactions for multiple entities? If so, then is it possible to
> define entity groups specific to the operation on the entities? i.e
> have define entity group for update but not delete? e.g. update of a
> parent's properties need not require any update of the child (in a one-
> many unowned relationship) whereas deleting a parent cascaded to all
> its children.
>
> As per documentation at 
> :http://code.google.com/appengine/docs/java/datastore/relationships.ht...
> "Second, all objects must belong to the same entity group in order to
> perform an atomic update of objects on both sides of the
> relationship."
>
> 2. For defining entity groups it is also mandated that we need to
> model the key field as a : Key or an encoded String as a Key. However
> we can model the key fields of unowned relationships as Long/numeric.
> If we use numeric keys for unowned relationships, then does it mean
> that we cannot use transactions for the same.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" 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-java?hl=en.

Reply via email to