RESOLVED - BATCH-950: Exception during rollback hides root cause

log original exception if rollback failed
This commit is contained in:
robokaso
2008-12-08 15:25:32 +00:00
parent 33ec4a5682
commit b1bcc8422f

View File

@@ -296,12 +296,24 @@ public class TaskletStep extends AbstractStep {
}
catch (Error e) {
processRollback(stepExecution, fatalException, transaction);
throw e;
try {
processRollback(stepExecution, fatalException, transaction);
throw e;
}
catch (Exception rollbackException) {
logger.error("Rollback failed, original error that caused the rollback is", e);
throw rollbackException;
}
}
catch (Exception e) {
processRollback(stepExecution, fatalException, transaction);
throw e;
try {
processRollback(stepExecution, fatalException, transaction);
throw e;
}
catch (Exception rollbackException) {
logger.error("Rollback failed, original exception that caused the rollback is", e);
throw rollbackException;
}
}
finally {
// only release the lock if we acquired it
@@ -349,6 +361,9 @@ public class TaskletStep extends AbstractStep {
fatalException.setException(e);
throw new FatalException("Failed while processing rollback", e);
}
else {
logger.error("Failed to rollback transaction", e);
}
}
if (fatalException.hasException()) {