ComputeFailureKey computeFailureKey = new ComputeFailureKey(item.getComputedValue().getSpecification().getFunctionUniqueId(), exceptionClass, exceptionMessage, exceptionStackTrace);
return getComputeFailureFromDb(computeFailureCache, computeFailureKey);
}
public ComputeFailure getComputeFailureFromDb(Map<ComputeFailureKey, ComputeFailure> computeFailureCache, ComputeFailureKey computeFailureKey) {
ComputeFailure computeFailure = computeFailureCache.get(computeFailureKey);
if (computeFailure != null) {
return computeFailure;
}
try {
int id = getJdbcTemplate().queryForObject(getElSqlBundle().getSql("SelectComputeFailureId"), DbBatchUtils.toSqlParameterSource(computeFailureKey), Integer.class);
computeFailure = new ComputeFailure();
computeFailure.setId(id);
computeFailure.setFunctionId(computeFailureKey.getFunctionId());
computeFailure.setExceptionClass(computeFailureKey.getExceptionClass());
computeFailure.setExceptionMsg(computeFailureKey.getExceptionMsg());
computeFailure.setStackTrace(computeFailureKey.getStackTrace());
computeFailureCache.put(computeFailureKey, computeFailure);
return computeFailure;
} catch (IncorrectResultSizeDataAccessException e) {
// Not seen a failure like this before - create and write to database
try {