[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] question about orthogonally handling exceptions
|
Hi Noah,
Registering an ExceptionHandler can be achieved using the
"eclipselink.exception-handler" persistence unit property.
-Tom
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?
Thanks,
-Noah
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users