Fixed case sensitivity issue when updating status in the cache.

This commit is contained in:
CalDescent 2023-05-12 20:10:51 +01:00
parent 36a731255a
commit 23d211836f

View File

@ -886,10 +886,10 @@ public class HSQLDBArbitraryRepository implements ArbitraryRepository {
if (status == null) { if (status == null) {
return; return;
} }
String updateSql = "UPDATE ArbitraryResourcesCache SET status = ? WHERE service = ? AND name = ? AND identifier = ?"; String updateSql = "UPDATE ArbitraryResourcesCache SET status = ? WHERE service = ? AND LCASE(name) = ? AND LCASE(identifier) = ?";
try { try {
this.repository.executeCheckedUpdate(updateSql, status.value, arbitraryResourceData.service.value, arbitraryResourceData.name, arbitraryResourceData.identifier); this.repository.executeCheckedUpdate(updateSql, status.value, arbitraryResourceData.service.value, arbitraryResourceData.name.toLowerCase(), arbitraryResourceData.identifier.toLowerCase());
} catch (SQLException e) { } catch (SQLException e) {
throw new DataException("Unable to set status for arbitrary resource", e); throw new DataException("Unable to set status for arbitrary resource", e);
} }