users@glassfish.java.net

Re: Unique Constraint Question

From: <glassfish_at_javadesktop.org>
Date: Thu, 06 Sep 2007 09:56:27 PDT

Commit is performed by the container after your session bean finishes execution of the business method and before the container returns information to the client. It's too late for your session bean to do anything.

You can force the flush to the database via em.flush() while you are still in your session bean, and process the exception, but there is no generic way to get from a PersistenceException to the SQLException, and no requirements to translate SQL error codes (that can be vendor specific) into separate exception types.

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

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