Skip to content

Commit 704bd5e

Browse files
committed
Support null startTime and EndTime for Db2 Task Execution Create
resolves #948
1 parent 5c84bd5 commit 704bd5e

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

spring-cloud-task-core/src/main/java/org/springframework/cloud/task/repository/dao/JdbcTaskExecutionDao.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,26 @@ public TaskExecution mapRow(ResultSet rs, int rowNum) throws SQLException {
617617
if (rs.wasNull()) {
618618
parentExecutionId = null;
619619
}
620-
return new TaskExecution(id, getNullableExitCode(rs), rs.getString("TASK_NAME"),
621-
rs.getObject("START_TIME", LocalDateTime.class), rs.getObject("END_TIME", LocalDateTime.class),
620+
LocalDateTime startTime = null;
621+
LocalDateTime endTime = null;
622+
try {
623+
startTime = rs.getObject("START_TIME", LocalDateTime.class);
624+
}
625+
catch (NullPointerException npe) {
626+
if (!npe.getMessage().contains("<local4>")) {
627+
throw npe;
628+
}
629+
}
630+
631+
try {
632+
endTime = rs.getObject("END_TIME", LocalDateTime.class);
633+
}
634+
catch (NullPointerException npe) {
635+
if (!npe.getMessage().contains("<local4>")) {
636+
throw npe;
637+
}
638+
}
639+
return new TaskExecution(id, getNullableExitCode(rs), rs.getString("TASK_NAME"), startTime, endTime,
622640
rs.getString("EXIT_MESSAGE"), getTaskArguments(id), rs.getString("ERROR_MESSAGE"),
623641
rs.getString("EXTERNAL_EXECUTION_ID"), parentExecutionId);
624642
}

0 commit comments

Comments
 (0)