users@glassfish.java.net

Re: Creating a custom sequence generator for JTA/toplink

From: <glassfish_at_javadesktop.org>
Date: Wed, 26 Mar 2008 12:43:37 PST

Yes, em.flush() after em.persist() should get the ids.
About constraint violations on em.persist(): is everything new or did you update the database side without refreshing it from em? TopLink by default caches all the fetched and comitted entities in its EMF (i.e. 2nd level) cache and assumes that there are no other changes to the database, than those done via em calls.

Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

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