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()); statement.setBytes(2, groupId.serialize());
final var result = Utils.executeQueryForOptional(statement, Utils::getIdMapper); final var result = Utils.executeQueryForOptional(statement, Utils::getIdMapper);
if (result.isEmpty()) { if (result.isEmpty()) {
connection.commit();
return; return;
} }
internalId = result.get(); internalId = result.get();

View File

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

View File

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