>From ejb-3.0-persistence-specification, section 3.2 I can read that

"A managed entity instance is an instance with a persistent identity
that is currently associated
with a persistence context."

>From this I understand that em.persist() (paragraph 3.1.1) should give
me the persistent identity.

Then we can read the same specs books, paragraph 2.1.4, that the
"persistent identity" of an Entity in the simpler case is the field/
property annotated from @Id.

Given this, from my point of view, after persist I should have the
chance to read my new persisted object identity.

This is something I can't do with DataNucleus.



On May 18, 8:04 pm, datanucleus <andy_jeffer...@yahoo.com> wrote:
> > and discovered that the entity key was not populated, but remain
> > "null" until the transaction is committed or a flush is done. This was
> > very confusing to me, because I know that, from JPA specs, the persist
> > change the state of the entity from new to managed, and being managed
> > means that the entity has a persistent identity, something not true here.
>
> There is nothing in the JPA spec to require the identity to be set
> before flush(). If there was do you really think that DataNucleus
> would pass the JPA1 TCK ? (which it does).
>
> > In my opinion this is a bug in DataNucleus that also affect our GAE
> > code, so I would like to file them a bug, what do you think ??
>
> If you think something is a bug against a spec then you quote the spec
> section that defines this incorrect behaviour.
> Since you are presumably defining "IDENTITY" as the value generation
> (but then you don't state this, so have to guess) and this is
> performed in the datastore and there is no requirement to put anything
> in the datastore until flush() then how exactly is the "identity" set
> before that ?
>
> --
> 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-j...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-appengine-java?hl=en.

-- 
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-j...@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