unupdatedItemIDs.remove(otherItemID);
}
} catch (SQLException sqle) {
log.warn("Exception while adding item diff", sqle);
throw new TasteException(sqle);
} finally {
IOUtils.quietClose(rs, stmt, conn);
}
// Catch antyhing that wasn't already covered in the diff table
try {
conn = dataSource.getConnection();
stmt = conn.prepareStatement(addDiffSQL);
for (long unupdatedItemID : unupdatedItemIDs) {
if (unupdatedItemID < itemID) {
stmt.setLong(1, unupdatedItemID);
stmt.setLong(2, itemID);
stmt.setFloat(3, prefValue);
} else {
stmt.setLong(1, itemID);
stmt.setLong(2, unupdatedItemID);
stmt.setFloat(3, -prefValue);
}
log.debug("Executing SQL query: {}", getDiffsAffectedByUserSQL);
stmt.executeUpdate();
}
} catch (SQLException sqle) {
log.warn("Exception while adding item diff", sqle);
throw new TasteException(sqle);
} finally {
IOUtils.quietClose(null, stmt, conn);
}
}