//Set exception handler if it was specified.
String exceptionHandlerClassName = EntityManagerFactoryProvider.getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.EXCEPTION_HANDLER_CLASS, m, session);
if(exceptionHandlerClassName!=null){
Class exceptionHandlerClass = findClassForProperty(exceptionHandlerClassName,PersistenceUnitProperties.EXCEPTION_HANDLER_CLASS, loader);
try {
ExceptionHandler exceptionHandler = (ExceptionHandler)buildObjectForClass(exceptionHandlerClass, ExceptionHandler.class);
if (exceptionHandler!=null){
session.setExceptionHandler(exceptionHandler);
} else {
session.handleException(ValidationException.invalidExceptionHandlerClass(exceptionHandlerClassName));
}