From 22fb6350e155dde3102b39a06dfa090ca3b15c9a Mon Sep 17 00:00:00 2001 From: robokaso Date: Tue, 9 Dec 2008 11:46:10 +0000 Subject: [PATCH] RESOLVED - BATCH-950: Exception during rollback hides root cause don't confuse rollback exception with the rollback cause --- .../batch/core/step/item/ItemOrientedStep.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/ItemOrientedStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/ItemOrientedStep.java index 92365057b..c7bcdc30b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/ItemOrientedStep.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/ItemOrientedStep.java @@ -315,22 +315,22 @@ public class ItemOrientedStep extends AbstractStep { catch (Error e) { try { processRollback(stepExecution, contribution, fatalException, transaction); - throw e; } catch (Exception rollbackException) { logger.error("Rollback failed, original exception that caused the rollback is", e); throw rollbackException; } + throw e; } catch (Exception e) { try { processRollback(stepExecution, contribution, fatalException, transaction); - throw e; } catch (Exception rollbackException) { logger.error("Rollback failed, original exception that caused the rollback is", e); throw rollbackException; } + throw e; } finally { // only release the lock if we acquired it