Skip to content

Commit

Permalink
Merge pull request #1992 from Expensify/ionatan_rollbackonreadquery
Browse files Browse the repository at this point in the history
Rollback transaction on DB plugin read query
  • Loading branch information
rlinoz authored Dec 2, 2024
2 parents 60731e6 + 5c1ba37 commit 612f165
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/DB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ bool BedrockDBCommand::peek(SQLite& db) {
return false;
}

// We rollback here because if we are in a transaction and the querytakes long (which the queries in this command can)
// it prevents sqlite from checkpointing and if we accumulate a lot of things to checkpoint, things become slow
((SQLite&) db).rollback();

// Attempt the read-only query
SQResult result;
if (!db.read(query, result)) {
Expand Down

0 comments on commit 612f165

Please sign in to comment.