[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[eclipselink-users] question about orthogonally handling exceptions
- From: Noah White <emailnbw@xxxxxxxxx>
- Date: Mon, 19 Nov 2012 10:57:45 -0500
- Delivered-to: email@example.com
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?