final String stackTrace = buffer.toString();
for (SqlParameterSource success : successes) {
failures.add(convertSuccessToFailure(success));
final long failureId = getId(success);
final long functionId = getFunctionId(success);
ComputeFailureKey computeFailureKey = new ComputeFailureKey(String.valueOf(functionId), exceptionClass, exceptionMsg, stackTrace);
ComputeFailure computeFailure = getComputeFailureFromDb(computeFailureCache, computeFailureKey);
final long failureReasonId = nextId(RSK_SEQUENCE_NAME);
failureReasons.add(getFailureReasonArgs(failureReasonId, failureId, computeFailure.getId()));
}
failedTargets.addAll(successfulTargets);