I've done some reading, and I think it's working properly... http://docs.jboss.org/ejb3/app-server/HibernateEntityManager/reference/en/html_single/index.html
Section 4.2.3. Exception handling anonymous wrote : If the EntityManager throws an exception (including any SQLException), you should immediately rollback the database transaction, call EntityManager.close() (if createEntityManager() has been called) and discard the EntityManager instance. Certain methods of EntityManager will not leave the persistence context in a consistent state. No exception thrown by an entity manager can be treated as recoverable. Ensure that the EntityManager will be closed by calling close() in a finally block. Note that a container managed entity manager will do that for you. You just have to let the RuntimeException propagate up to the container. So it would seem that catching the exception in the calling code is the only way to go. Following this approach, then the link that Jono provided gives all the information you need, namely 1) calling em.flush and 2) creating and annotating a checked excpetion (with @ApplicationException) http://www.jboss.com/index.html?module=bb&op=viewtopic&t=71611 Cheers, Jason View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3918343#3918343 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3918343 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user