When my servlet tried to write a record, it encontered the following
exception:

javax.persistence.EntityNotFoundException: Could not retrieve entity
of kind MyEntity with key MyEntity(1318001)

even if I have check and ensured that the id 1318001 doesn't exist in
my datastore. It happened when my servlet commit the transation.

Here is my coding:

EntityManagerFactory emfInstance =
        Persistence.createEntityManagerFactory("transactions-
optional");
EntityManager em = emfInstance.createEntityManager();
em.getTransaction().begin();
MyEntity ent = new MyEntity(....);
em.persist(ent);
log.info(ent.toString());
em.getTransaction().commit();

I can see my ent in the log, but it caused the exception in the commit
statement. Can somebody please help.

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

Reply via email to