about summary refs log tree commit diff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-02-24T10·57+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-02-24T10·57+0000
commit462bd50aefca3d70e76ccf17f42c2aef4714c95b (patch)
treef5d89d844ef098b18b434fc7be8315891360e170 /src/libstore/local-store.cc
parent8520de4720a798701a41b6ab3e6cf8d6cc71caa3 (diff)
* Use normal (rather than full) synchronous mode, which I gather from
  the description at http://www.sqlite.org/atomiccommit.html should be
  safe enough.

Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc4
1 files changed, 4 insertions, 0 deletions
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. */