I don't think there is a way to tweak the hibernate, unless you would change it's code a lot. You will probrably need to do something like this:
Code:
...
} catch (Exception e) {
if (causedByBatchUpdateException(e)) {
//display it
} else {
throw e;
}
}
...
private boolean causedByBatchUpdateException(Exception e)
{
Exception cause = e;
while (cause != null) {
if (cause instanceof BatchUpdateException) {
return true; //if it is your exception you want to handle, return true
}
cause = e.getCause(); //look in the cause
if (e == cause) {
cause = null; //end in case, exception is referencing itself
}
}
return false;
}
Regards,
Pavol