[Fix] Gracefully handle not being able to update a LogMessage
This commit is contained in:
parent
6d02372e71
commit
17645c11a2
|
@ -121,12 +121,8 @@ public class PostgreSqlLogMessageDao implements LogMessageDao {
|
||||||
ps.setString(1, logMessage.getState().name());
|
ps.setString(1, logMessage.getState().name());
|
||||||
ps.setString(2, logMessage.getId());
|
ps.setString(2, logMessage.getId());
|
||||||
|
|
||||||
int count = ps.executeUpdate();
|
// we ignore the number of updates, as the message might have been deleted meanwhile
|
||||||
if (count != 1) {
|
ps.executeUpdate();
|
||||||
throw new StrolchPersistenceException(MessageFormat
|
|
||||||
.format("Expected to update 1 log_message record, but updated {0} for LogMessage {1}", count,
|
|
||||||
logMessage.getId())); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new StrolchPersistenceException(MessageFormat
|
throw new StrolchPersistenceException(MessageFormat
|
||||||
|
|
Loading…
Reference in New Issue