diff --git a/src/common/repository/sqlite/SqliteDatabase.cxx b/src/common/repository/sqlite/SqliteDatabase.cxx index e349c0c2f..ecc8e3f8c 100644 --- a/src/common/repository/sqlite/SqliteDatabase.cxx +++ b/src/common/repository/sqlite/SqliteDatabase.cxx @@ -74,6 +74,11 @@ void SqliteDatabase::initialize() throw SqliteError("unable to initialize sqlite DB for unknown reason"); }; + + exec("PRAGMA journal_mode=WAL"); + + if (sqlite3_wal_checkpoint_v2(myHandle, nullptr, SQLITE_CHECKPOINT_TRUNCATE, nullptr, nullptr) != SQLITE_OK) + throw SqliteError(sqlite3_errmsg(myHandle)); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -