Fix retrieval of null job parameters of type long/double
Before this commit, a null job parameter of type long or double was retrieved as 0L or 0.0. This caused JobOperator.restart to create a new job instance instead of restarting the previous failed execution. This commit fixes how null job parameters of type long or double are retrieved from the database to correctly restart the same job instance. Issue #4087
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
2bdf4283e0
commit
fdd253a7e6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2019 the original author or authors.
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -374,9 +374,11 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
|
||||
if (type == ParameterType.STRING) {
|
||||
value = new JobParameter(rs.getString(4), rs.getString(8).equalsIgnoreCase("Y"));
|
||||
} else if (type == ParameterType.LONG) {
|
||||
value = new JobParameter(rs.getLong(6), rs.getString(8).equalsIgnoreCase("Y"));
|
||||
long longValue = rs.getLong(6);
|
||||
value = new JobParameter(rs.wasNull() ? null : longValue, rs.getString(8).equalsIgnoreCase("Y"));
|
||||
} else if (type == ParameterType.DOUBLE) {
|
||||
value = new JobParameter(rs.getDouble(7), rs.getString(8).equalsIgnoreCase("Y"));
|
||||
double doubleValue = rs.getDouble(7);
|
||||
value = new JobParameter(rs.wasNull() ? null : doubleValue, rs.getString(8).equalsIgnoreCase("Y"));
|
||||
} else if (type == ParameterType.DATE) {
|
||||
value = new JobParameter(rs.getTimestamp(5), rs.getString(8).equalsIgnoreCase("Y"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user