From 462bd50aefca3d70e76ccf17f42c2aef4714c95b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 24 Feb 2010 10:57:57 +0000 Subject: [PATCH] * Use normal (rather than full) synchronous mode, which I gather from the description at http://www.sqlite.org/atomiccommit.html should be safe enough. --- src/libstore/local-store.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 7db2aabe48..8e54484460 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -219,6 +219,10 @@ LocalStore::LocalStore() /* !!! check whether sqlite has been built with foreign key support */ + /* "Normal" synchronous mode should be safe enough. */ + if (sqlite3_exec(db, "pragma synchronous = normal;", 0, 0, 0) != SQLITE_OK) + throw SQLiteError(db, "changing synchronous mode to normal"); + /* Check the current database schema and if necessary do an upgrade. !!! Race condition: several processes could start the upgrade at the same time. */