Add commits in early returns

This commit is contained in:
AsamK 2026-04-11 12:26:24 +02:00
parent 132dfb95dc
commit e9eabbeeb5
3 changed files with 4 additions and 1 deletions

View File

@ -152,6 +152,7 @@ public class GroupStore {
statement.setBytes(2, groupId.serialize());
final var result = Utils.executeQueryForOptional(statement, Utils::getIdMapper);
if (result.isEmpty()) {
connection.commit();
return;
}
internalId = result.get();

View File

@ -303,6 +303,7 @@ public class MessageSendLogStore implements AutoCloseable {
}
if (contentId == -1) {
logger.warn("Failed to insert message send log content");
connection.commit();
return -1;
}
insertRecipientsForExistingContent(contentId, recipientDevices, connection);

View File

@ -194,8 +194,9 @@ public class SessionStore implements SignalServiceSessionStore {
if (session != null) {
session.archiveCurrentState();
storeSession(connection, key, session);
connection.commit();
}
connection.commit();
} catch (SQLException e) {
throw new RuntimeException("Failed update session store", e);
}