comparison OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp @ 5057:e6f26be401fa

SQLite: close and delete WAL and SHM files on exit (contribution from Sebastian Höffner)
author Alain Mazy <am@osimis.io>
date Tue, 02 Aug 2022 11:38:31 +0200
parents 6eff25f70121
children d7274e43ea7c cc1a8b3ff319
comparison
equal deleted inserted replaced
5056:191e86305f19 5057:e6f26be401fa
1369 1369
1370 1370
1371 void SQLiteDatabaseWrapper::Close() 1371 void SQLiteDatabaseWrapper::Close()
1372 { 1372 {
1373 boost::mutex::scoped_lock lock(mutex_); 1373 boost::mutex::scoped_lock lock(mutex_);
1374 // close and delete the WAL when exiting properly -> the DB is stored in a single file (no more -wal and -shm files)
1375 db_.Execute("PRAGMA JOURNAL_MODE=DELETE;");
1374 db_.Close(); 1376 db_.Close();
1375 } 1377 }
1376 1378
1377 1379
1378 static void ExecuteUpgradeScript(SQLite::Connection& db, 1380 static void ExecuteUpgradeScript(SQLite::Connection& db,