[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [eclipselink-users] question about orthogonally handling exceptions
- From: Tom Ware <tom.ware@xxxxxxxxxx>
- Date: Mon, 19 Nov 2012 11:53:11 -0500
- Delivered-to: email@example.com
- Organization: Oracle Corporation
- User-agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
Registering an ExceptionHandler can be achieved using the
"eclipselink.exception-handler" persistence unit property.
On 19/11/2012 10:57 AM, Noah White wrote:
Is there a way to orthogonally handle exceptions that come from the DB. For example I would like to handle java.sql.Exception ORA-28001: the password has expired. This manifests as a java.lang.reflect.UndeclaredThrowableException from org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:123).
Can I register an application level exception handler for something like this via a property in the persistence.xml or annotation or some such?
It looks like I could use something like org.eclipse.persistence.exceptions.ExceptionHandler. It looks like this has to be registered to the session. In my environment I inject a @PersistenceContentext into an EJB (3.1). This is in Glassfish 3.1.2 using container managed connection pooling w/a JTA resource.
What's the best way to go about getting the Session in this case?
eclipselink-users mailing list