in ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java [266:284]
private boolean updateJobExecutionEventFailure(final JobExecutionEvent event) {
boolean result = false;
try (
Connection connection = dataSource.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement(sqlMapper.getUpdateForJobExecutionLogForFailure())) {
preparedStatement.setBoolean(1, event.isSuccess());
preparedStatement.setTimestamp(2, new Timestamp(event.getCompleteTime().getTime()));
preparedStatement.setString(3, truncateString(event.getFailureCause()));
preparedStatement.setString(4, event.getId());
if (0 == preparedStatement.executeUpdate()) {
return insertJobExecutionEventWhenFailure(event);
}
result = true;
} catch (final SQLException ex) {
// TODO log failure directly to output log, consider to be configurable in the future
log.error(ex.getMessage());
}
return result;
}