[Fix] Gracefully handle not being able to update a LogMessage

This commit is contained in:
Robert von Burg 2020-06-18 16:26:51 +02:00
parent 6d02372e71
commit 17645c11a2
1 changed files with 2 additions and 6 deletions

View File

@ -121,12 +121,8 @@ public class PostgreSqlLogMessageDao implements LogMessageDao {
ps.setString(1, logMessage.getState().name());
ps.setString(2, logMessage.getId());
int count = ps.executeUpdate();
if (count != 1) {
throw new StrolchPersistenceException(MessageFormat
.format("Expected to update 1 log_message record, but updated {0} for LogMessage {1}", count,
logMessage.getId())); //$NON-NLS-1$
}
// we ignore the number of updates, as the message might have been deleted meanwhile
ps.executeUpdate();
} catch (SQLException e) {
throw new StrolchPersistenceException(MessageFormat