diff Core/SQLite/Connection.cpp @ 206:4453a010d0db

flush to disk thread
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Nov 2012 12:03:18 +0100
parents 2dece1526c06
children 42e87c17cab8
line wrap: on
line diff
--- a/Core/SQLite/Connection.cpp	Wed Nov 28 11:34:54 2012 +0100
+++ b/Core/SQLite/Connection.cpp	Wed Nov 28 12:03:18 2012 +0100
@@ -372,5 +372,16 @@
       return func;
     }
 
+
+    void Connection::FlushToDisk()
+    {
+      VLOG(1) << "SQLite::Connection::FlushToDisk";
+      int err = sqlite3_wal_checkpoint(db_, NULL);
+
+      if (err != SQLITE_OK)
+      {
+        throw OrthancException("SQLite: Unable to flush the database");
+      }
+    }
   }
 }