From 3ebde0b1c89e06cfd640bf7343859ce8f8e53d9e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 1 Mar 2021 19:19:52 +0300 Subject: fixes #2735 ([dbx_sqlite][db_autobackups] db backups are intermittently created as 0-byte files) --- plugins/Dbx_sqlite/src/dbintf.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/Dbx_sqlite/src') diff --git a/plugins/Dbx_sqlite/src/dbintf.cpp b/plugins/Dbx_sqlite/src/dbintf.cpp index 76e83c277f..c95af86ae8 100755 --- a/plugins/Dbx_sqlite/src/dbintf.cpp +++ b/plugins/Dbx_sqlite/src/dbintf.cpp @@ -167,9 +167,15 @@ BOOL CDbxSQLite::Backup(LPCWSTR profile) return ERROR_BACKUP_CONTROLLER; } + rc = sqlite3_exec(m_db, "commit;", nullptr, nullptr, nullptr); + logError(rc, __FILE__, __LINE__); + logError(sqlite3_backup_step(backup, -1), __FILE__, __LINE__); logError(sqlite3_backup_finish(backup), __FILE__, __LINE__); sqlite3_close(database); + + rc = sqlite3_exec(m_db, "begin transaction;", nullptr, nullptr, nullptr); + logError(rc, __FILE__, __LINE__); return 0; } -- cgit v1.2.3