From 542b3f74b8ed0d14b4b14f18e72cfd93b939acc4 Mon Sep 17 00:00:00 2001 From: dsyer Date: Fri, 15 Feb 2008 15:35:49 +0000 Subject: [PATCH] OPEN - issue BATCH-364: StepScope responsibilities can be assumed by Step (not ApplicationContext) http://jira.springframework.org/browse/BATCH-364 One more test to fix. --- .../batch/execution/step/simple/SimpleStepExecutor.java | 8 +++++++- spring-batch-execution/src/main/resources/schema-db2.sql | 2 +- .../src/main/resources/schema-derby.sql | 2 +- .../src/main/resources/schema-hsqldb.sql | 2 +- .../src/main/resources/schema-mysql.sql | 2 +- .../src/main/resources/schema-oracle10g.sql | 2 +- .../src/main/resources/schema-postgresql.sql | 2 +- spring-batch-execution/src/main/sql/init.sql.vpp | 2 +- .../batch/execution/repository/dao/init.sql | 2 +- 9 files changed, 15 insertions(+), 9 deletions(-) diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java index 7e8d0357d..b14b0c2f6 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java @@ -592,6 +592,12 @@ public class SimpleStepExecutor implements InitializingBean { */ private void updateStatus(StepExecution stepExecution, BatchStatus status) { stepExecution.setStatus(status); - jobRepository.saveOrUpdate(stepExecution); + try { + jobRepository.saveOrUpdate(stepExecution); + } + catch (Exception e) { + logger.error("Failed to update step execution with status: probably fatal.", e); + } + } } diff --git a/spring-batch-execution/src/main/resources/schema-db2.sql b/spring-batch-execution/src/main/resources/schema-db2.sql index 4741d0188..ca3cdfa53 100644 --- a/spring-batch-execution/src/main/resources/schema-db2.sql +++ b/spring-batch-execution/src/main/resources/schema-db2.sql @@ -53,7 +53,7 @@ CREATE TABLE BATCH_STEP_EXECUTION ( STATUS VARCHAR(10), COMMIT_COUNT BIGINT , TASK_COUNT BIGINT , - TASK_STATISTICS VARCHAR(500), + TASK_STATISTICS VARCHAR(4000), CONTINUABLE CHAR(1), EXIT_CODE VARCHAR(20), EXIT_MESSAGE VARCHAR(2500)); diff --git a/spring-batch-execution/src/main/resources/schema-derby.sql b/spring-batch-execution/src/main/resources/schema-derby.sql index bab71fd02..3c10bab65 100644 --- a/spring-batch-execution/src/main/resources/schema-derby.sql +++ b/spring-batch-execution/src/main/resources/schema-derby.sql @@ -53,7 +53,7 @@ CREATE TABLE BATCH_STEP_EXECUTION ( STATUS VARCHAR(10), COMMIT_COUNT BIGINT , TASK_COUNT BIGINT , - TASK_STATISTICS VARCHAR(500), + TASK_STATISTICS VARCHAR(4000), CONTINUABLE CHAR(1), EXIT_CODE VARCHAR(20), EXIT_MESSAGE VARCHAR(2500)); diff --git a/spring-batch-execution/src/main/resources/schema-hsqldb.sql b/spring-batch-execution/src/main/resources/schema-hsqldb.sql index f045b38f6..50c7c2084 100644 --- a/spring-batch-execution/src/main/resources/schema-hsqldb.sql +++ b/spring-batch-execution/src/main/resources/schema-hsqldb.sql @@ -53,7 +53,7 @@ CREATE TABLE BATCH_STEP_EXECUTION ( STATUS VARCHAR(10), COMMIT_COUNT BIGINT , TASK_COUNT BIGINT , - TASK_STATISTICS VARCHAR(500), + TASK_STATISTICS VARCHAR(4000), CONTINUABLE CHAR(1), EXIT_CODE VARCHAR(20), EXIT_MESSAGE VARCHAR(2500)); diff --git a/spring-batch-execution/src/main/resources/schema-mysql.sql b/spring-batch-execution/src/main/resources/schema-mysql.sql index 6b024de36..72f0b364c 100644 --- a/spring-batch-execution/src/main/resources/schema-mysql.sql +++ b/spring-batch-execution/src/main/resources/schema-mysql.sql @@ -53,7 +53,7 @@ CREATE TABLE BATCH_STEP_EXECUTION ( STATUS VARCHAR(10), COMMIT_COUNT BIGINT , TASK_COUNT BIGINT , - TASK_STATISTICS VARCHAR(500), + TASK_STATISTICS VARCHAR(4000), CONTINUABLE CHAR(1), EXIT_CODE VARCHAR(20), EXIT_MESSAGE VARCHAR(2500)); diff --git a/spring-batch-execution/src/main/resources/schema-oracle10g.sql b/spring-batch-execution/src/main/resources/schema-oracle10g.sql index 1f58e0d45..ed6735483 100644 --- a/spring-batch-execution/src/main/resources/schema-oracle10g.sql +++ b/spring-batch-execution/src/main/resources/schema-oracle10g.sql @@ -53,7 +53,7 @@ CREATE TABLE BATCH_STEP_EXECUTION ( STATUS VARCHAR(10), COMMIT_COUNT NUMBER(38) , TASK_COUNT NUMBER(38) , - TASK_STATISTICS VARCHAR(500), + TASK_STATISTICS VARCHAR(4000), CONTINUABLE CHAR(1), EXIT_CODE VARCHAR(20), EXIT_MESSAGE VARCHAR(2500)); diff --git a/spring-batch-execution/src/main/resources/schema-postgresql.sql b/spring-batch-execution/src/main/resources/schema-postgresql.sql index 4741d0188..ca3cdfa53 100644 --- a/spring-batch-execution/src/main/resources/schema-postgresql.sql +++ b/spring-batch-execution/src/main/resources/schema-postgresql.sql @@ -53,7 +53,7 @@ CREATE TABLE BATCH_STEP_EXECUTION ( STATUS VARCHAR(10), COMMIT_COUNT BIGINT , TASK_COUNT BIGINT , - TASK_STATISTICS VARCHAR(500), + TASK_STATISTICS VARCHAR(4000), CONTINUABLE CHAR(1), EXIT_CODE VARCHAR(20), EXIT_MESSAGE VARCHAR(2500)); diff --git a/spring-batch-execution/src/main/sql/init.sql.vpp b/spring-batch-execution/src/main/sql/init.sql.vpp index 5e8bcdf5b..cd85fc0d3 100644 --- a/spring-batch-execution/src/main/sql/init.sql.vpp +++ b/spring-batch-execution/src/main/sql/init.sql.vpp @@ -40,7 +40,7 @@ CREATE TABLE BATCH_STEP_EXECUTION ( STATUS VARCHAR(10), COMMIT_COUNT ${BIGINT} , TASK_COUNT ${BIGINT} , - TASK_STATISTICS VARCHAR(500), + TASK_STATISTICS VARCHAR(4000), CONTINUABLE CHAR(1), EXIT_CODE VARCHAR(20), EXIT_MESSAGE VARCHAR(2500)); diff --git a/spring-batch-execution/src/test/resources/org/springframework/batch/execution/repository/dao/init.sql b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/repository/dao/init.sql index cd97e0f5a..cff8fb2da 100644 --- a/spring-batch-execution/src/test/resources/org/springframework/batch/execution/repository/dao/init.sql +++ b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/repository/dao/init.sql @@ -40,7 +40,7 @@ CREATE TABLE BATCH_STEP_EXECUTION ( STATUS VARCHAR(10), COMMIT_COUNT BIGINT , TASK_COUNT BIGINT , - TASK_STATISTICS VARCHAR(500), + TASK_STATISTICS VARCHAR(4000), CONTINUABLE CHAR(1), EXIT_CODE VARCHAR(20), EXIT_MESSAGE VARCHAR(2500));