|
19 | 19 | import org.springframework.batch.io.exception.BatchCriticalException; |
20 | 20 | import org.springframework.batch.item.ExecutionContext; |
21 | 21 | import org.springframework.batch.repeat.ExitStatus; |
22 | | -import org.springframework.batch.support.PropertiesConverter; |
23 | 22 | import org.springframework.beans.factory.InitializingBean; |
24 | 23 | import org.springframework.dao.DataAccessException; |
25 | 24 | import org.springframework.dao.OptimisticLockingFailureException; |
@@ -63,18 +62,18 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement |
63 | 62 | + " KEY_NAME, STRING_VAL, DOUBLE_VAL, LONG_VAL, OBJECT_VAL) values(?,?,?,?,?,?,?)"; |
64 | 63 |
|
65 | 64 | private static final String SAVE_STEP_EXECUTION = "INSERT into %PREFIX%STEP_EXECUTION(STEP_EXECUTION_ID, VERSION, STEP_NAME, JOB_EXECUTION_ID, START_TIME, " |
66 | | - + "END_TIME, STATUS, COMMIT_COUNT, TASK_COUNT, TASK_STATISTICS, CONTINUABLE, EXIT_CODE, EXIT_MESSAGE) " |
67 | | - + "values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; |
| 65 | + + "END_TIME, STATUS, COMMIT_COUNT, TASK_COUNT, CONTINUABLE, EXIT_CODE, EXIT_MESSAGE) " |
| 66 | + + "values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; |
68 | 67 |
|
69 | 68 | private static final String UPDATE_STEP_EXECUTION_CONTEXT = "UPDATE %PREFIX%STEP_EXECUTION_CONTEXT set " |
70 | 69 | + "TYPE_CD = ?, STRING_VAL = ?, DOUBLE_VAL = ?, LONG_VAL = ?, OBJECT_VAL = ? where STEP_EXECUTION_ID = ? and KEY_NAME = ?"; |
71 | 70 |
|
72 | 71 | private static final String UPDATE_STEP_EXECUTION = "UPDATE %PREFIX%STEP_EXECUTION set START_TIME = ?, END_TIME = ?, " |
73 | | - + "STATUS = ?, COMMIT_COUNT = ?, TASK_COUNT = ?, TASK_STATISTICS = ?, CONTINUABLE = ? , EXIT_CODE = ?, " |
| 72 | + + "STATUS = ?, COMMIT_COUNT = ?, TASK_COUNT = ?, CONTINUABLE = ? , EXIT_CODE = ?, " |
74 | 73 | + "EXIT_MESSAGE = ?, VERSION = ? where STEP_EXECUTION_ID = ? and VERSION = ?"; |
75 | 74 |
|
76 | 75 | private static final String GET_STEP_EXECUTION = "SELECT STEP_EXECUTION_ID, STEP_NAME, START_TIME, END_TIME, STATUS, COMMIT_COUNT," |
77 | | - + " TASK_COUNT, TASK_STATISTICS, CONTINUABLE, EXIT_CODE, EXIT_MESSAGE from %PREFIX%STEP_EXECUTION where STEP_NAME = ? and JOB_EXECUTION_ID = ?"; |
| 76 | + + " TASK_COUNT, CONTINUABLE, EXIT_CODE, EXIT_MESSAGE from %PREFIX%STEP_EXECUTION where STEP_NAME = ? and JOB_EXECUTION_ID = ?"; |
78 | 77 |
|
79 | 78 | private static final int EXIT_MESSAGE_LENGTH = 250; |
80 | 79 |
|
@@ -179,14 +178,13 @@ public void saveStepExecution(StepExecution stepExecution) { |
179 | 178 | stepExecution.getStepName(), stepExecution.getJobExecutionId(), stepExecution.getStartTime(), |
180 | 179 | stepExecution.getEndTime(), stepExecution.getStatus().toString(), stepExecution.getCommitCount(), |
181 | 180 | stepExecution.getTaskCount(), |
182 | | - PropertiesConverter.propertiesToString(stepExecution.getExecutionContext().getProperties()), |
183 | 181 | stepExecution.getExitStatus().isContinuable() ? "Y" : "N", stepExecution.getExitStatus().getExitCode(), |
184 | 182 | stepExecution.getExitStatus().getExitDescription() }; |
185 | 183 | getJdbcTemplate().update( |
186 | 184 | getQuery(SAVE_STEP_EXECUTION), |
187 | 185 | parameters, |
188 | 186 | new int[] { Types.INTEGER, Types.INTEGER, Types.VARCHAR, Types.INTEGER, Types.TIMESTAMP, |
189 | | - Types.TIMESTAMP, Types.VARCHAR, Types.INTEGER, Types.INTEGER, Types.VARCHAR, Types.CHAR, |
| 187 | + Types.TIMESTAMP, Types.VARCHAR, Types.INTEGER, Types.INTEGER, Types.CHAR, |
190 | 188 | Types.VARCHAR, Types.VARCHAR }); |
191 | 189 | } |
192 | 190 |
|
@@ -314,15 +312,14 @@ public void updateStepExecution(StepExecution stepExecution) { |
314 | 312 | Integer version = new Integer(stepExecution.getVersion().intValue() + 1); |
315 | 313 | Object[] parameters = new Object[] { stepExecution.getStartTime(), stepExecution.getEndTime(), |
316 | 314 | stepExecution.getStatus().toString(), stepExecution.getCommitCount(), stepExecution.getTaskCount(), |
317 | | - PropertiesConverter.propertiesToString(stepExecution.getExecutionContext().getProperties()), |
318 | 315 | stepExecution.getExitStatus().isContinuable() ? "Y" : "N", |
319 | 316 | stepExecution.getExitStatus().getExitCode(), exitDescription, version, stepExecution.getId(), |
320 | 317 | stepExecution.getVersion() }; |
321 | 318 | int count = getJdbcTemplate().update( |
322 | 319 | getQuery(UPDATE_STEP_EXECUTION), |
323 | 320 | parameters, |
324 | 321 | new int[] { Types.TIMESTAMP, Types.TIMESTAMP, Types.VARCHAR, Types.INTEGER, Types.INTEGER, |
325 | | - Types.VARCHAR, Types.CHAR, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER, |
| 322 | + Types.CHAR, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER, |
326 | 323 | Types.INTEGER }); |
327 | 324 |
|
328 | 325 | // Avoid concurrent modifications... |
@@ -356,7 +353,7 @@ public Object mapRow(ResultSet rs, int rowNum) throws SQLException { |
356 | 353 | stepExecution.setCommitCount(rs.getInt(6)); |
357 | 354 | stepExecution.setTaskCount(rs.getInt(7)); |
358 | 355 | stepExecution |
359 | | - .setExitStatus(new ExitStatus("Y".equals(rs.getString(9)), rs.getString(10), rs.getString(11))); |
| 356 | + .setExitStatus(new ExitStatus("Y".equals(rs.getString(8)), rs.getString(9), rs.getString(10))); |
360 | 357 | stepExecution.setExecutionContext(findExecutionContext(stepExecution)); |
361 | 358 | return stepExecution; |
362 | 359 | } |
@@ -408,7 +405,6 @@ public static AttributeType getType(String typeAsString) { |
408 | 405 | return null; |
409 | 406 | } |
410 | 407 | } |
411 | | - |
412 | 408 | public StepExecution getStepExecution(JobExecution jobExecution, Step step) { |
413 | 409 | List executions = getJdbcTemplate().query(getQuery(GET_STEP_EXECUTION), |
414 | 410 | new Object[] { step.getName(), jobExecution.getId() }, new StepExecutionRowMapper(jobExecution, step)); |
|
0 commit comments