*/
private void handleCallbackExceptions(Exception[] exceps, int mode) {
if (exceps.length == 0 || (mode & CALLBACK_IGNORE) != 0)
return;
OpenJPAException ce;
if (exceps.length == 1) {
// If the exception is already a wrapped exception throw the
// exception instead of wrapping it with a callback exception
if (exceps[0] instanceof WrappedException)
throw (WrappedException)exceps[0];
else
ce = new CallbackException(exceps[0]);
} else {
ce = new CallbackException(_loc.get("callback-err")).
setNestedThrowables(exceps);
}
if ((mode & CALLBACK_ROLLBACK) != 0 && (_flags & FLAG_ACTIVE) != 0) {
ce.setFatal(true);
setRollbackOnlyInternal(ce);
}
if ((mode & CALLBACK_LOG) != 0 && _log.isWarnEnabled())
_log.warn(ce);
if ((mode & CALLBACK_RETHROW) != 0)