users@glassfish.java.net

Re: JPA Id fields???

From: <glassfish_at_javadesktop.org>
Date: Mon, 20 Aug 2007 08:43:20 PDT

Hello,

Why are you trying to refresh a new object? The spec is unclear on what should happen when you refresh a just persisted object, but states that objects that do not exist should cause an EntityNotFoundException if it doesn't exist in the database - which is what you are getting. So the exception should occur regardless of the ID being generated correctly or not.

Try turning logging on to finest to see if any messages indicate there are warnings that could have been missed. Marina also suggested using em.flush() after the persist call to see if that helps.

Best Regards,
Chris
[Message sent by forum member 'chris_delahunt' (chris_delahunt)]

http://forums.java.net/jive/thread.jspa?messageID=231639