I see that the GAE/J documentation states
"Queries inside transactions must include ancestor filters.
Datastore transactions operate only on entities belonging to the same
entity group (descended from a common ancestor). To preserve this
restriction, all queries performed within a transaction must include
an ancestor filter specifying an ancestor in the same entity group as
the other operations in the transaction."
My application features JDO queries that fetch, within a transaction,
a persistent entity without an ancestor (because it is the sole entity
in its entity group and/or the root entity of its entity group).
One of the ways that I meet the datastore restriction above is to use
public <T> T javax.jdo.PersistenceManager.getObjectById(Class<T>
cls, Object key)
from within a transaction to obtain the root persistent entity sought.
(The key will contain the information that the entity sought has no
ancestor.)
My memory tells me that there is another way which I use; I simply
ensure that just one entity is returned from a query within a
transaction. This obviates returning entities from more than one
entity group!
On 11 Oct, 19:44, D X <
drag...@gmail.com> wrote:
> My understanding is an entity with no parent is essentially its own entity
> group.
>
> If you're trying to use multiple entity groups within a transaction, you
> must use a cross-group transaction, and you're limited to 5 entity groups
> (ie, 5 entities) within a transaction. Beyond that you have to restructure
> your entities to get within that limit.
>
>
>
>
>
>
>
> On Thursday, October 11, 2012 8:32:58 AM UTC-4, Olivier Truemat wrote:
>
> > *Richard,*
>
> > Thanks for your feedback.
>
> > *Ian,*