Defining an Entity Group

1 view
Skip to first unread message

Yagiz Erkan

unread,
Jun 30, 2008, 7:29:54 AM6/30/08
to google-a...@googlegroups.com
Hi,

Can somebody point me to a resource explaining how to define an entity
group please? The official doc
(http://code.google.com/appengine/docs/datastore/keysandentitygroups.html#Entity_Groups_Ancestors_and_Paths)
doesn't show much...

Thanks,

- Yagiz -

g-man

unread,
Jul 5, 2008, 11:18:44 PM7/5/08
to Google App Engine
I'm just getting into that now, too...

Any news?

David Symonds

unread,
Jul 6, 2008, 12:39:46 AM7/6/08
to google-a...@googlegroups.com

There really isn't anything more to it: by default, every entity is in
its own entity group; if you declare entity A to be the parent of
entity B, then B is in A's entity group instead of its own.


Dave.

Yagiz Erkan

unread,
Jul 6, 2008, 3:09:20 PM7/6/08
to google-a...@googlegroups.com
Yes, I discovered that just after sending the message. I apologize...
Following the good netiquette I should've replied to my own message
for the others... which I usually do when my question is unanswered
but I forgot it this time...

Thanks Dave!

- Yagiz -

g-man

unread,
Jul 6, 2008, 6:25:53 PM7/6/08
to Google App Engine
Hi,

My question is going to this:

Can different entity kinds be part of a group?

I have blog Items, and each Item can have Comments (which have a
ReferenceProperty to the 'parent' Item).

I want to delete an Item and all its Comments, so I thought an entity
group would be good to run in a transaction, otherwise if there was a
problem, I could be left with orphaned Comments (without an Item), or
an Item with missing Comments.

As I experiment with this, I'm not getting the entity group membership
set or acknowledged, and when I try the transaction, I get an error. I
fear that only entities of one kind can belong to a group, but what's
the good of that in my case, and how do I do my transaction with
safety otherwise?

Any ideas?

Thanks!

David Symonds

unread,
Jul 7, 2008, 4:53:08 AM7/7/08
to google-a...@googlegroups.com
On Mon, Jul 7, 2008 at 8:25 AM, g-man <greg...@gmail.com> wrote:

> My question is going to this:
>
> Can different entity kinds be part of a group?

Yes, definitely.

> I have blog Items, and each Item can have Comments (which have a
> ReferenceProperty to the 'parent' Item).
>
> I want to delete an Item and all its Comments, so I thought an entity
> group would be good to run in a transaction, otherwise if there was a
> problem, I could be left with orphaned Comments (without an Item), or
> an Item with missing Comments.

Be aware that writes are transactionally serialised for the entity
group it is changing. If you're deleting, that's probably not an
issue, though.


Dave.

Reply all
Reply to author
Forward
0 new messages