Interesting.  If they're all in the same entity group, how about you
save the group without the keys set, then set the keys and save again,
all in the same transaction?

On Sep 19, 11:08 am, mlenormand <mickael.lenorm...@gmail.com> wrote:
> All the entities we are talking about are in the SAME entity group in
> order to create/update them in the same transaction. In addition to
> that, we declare an unowned relationship, using "Key" for example. I
> want to save all my entities in the same transaction.
>
> On Sep 19, 5:52 pm, objectuser <kevin.k.le...@gmail.com> wrote:
>
> > Because your relationships are unowned (so the objects are in
> > different entity groups, right?), you wouldn't be able to save them
> > all in the same transaction anyway.
>
> > So you're right: you'll have to save them, which means multiple
> > transactions, and if one of them fails you'll have inconsistent data.
>
> > On Sep 19, 8:47 am, mlenormand <mickael.lenorm...@gmail.com> wrote:
>
> > > Hi Everybody,
>
> > > Here's my problem with JDO and unowned relationships :
>
> > > I have several entities of the same kind that are organized in a
> > > hierarchical way, maintained with unowned relationships.
> > > JDO can generate keys for my entities when they are written to the
> > > datastore, but with this option, I can't know my entity's keys until
> > > they are saved to the datastore. If I want to make a reference to an
> > > entity A from an entity B, it seems to be impossible because at this
> > > time I don't know A's key, that will be generated when transaction is
> > > committed.
>
> > > One solution would be to use several transactions, each one would
> > > persist an entity, but it's not good because I want to persist all the
> > > entities in the same transaction.
>
> > > I know that defining keys myself could solve the problem, but maybe
> > > there is an other solution that would be better ?
>
> > > Thank you for your help. And thank you to the GAE team for the
> > > fantastic work you did !
--~--~---------~--~----~------------~-------~--~----~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to