eda/EDASQLite: Fixed resetting locking mode to normal before closing database
authorJerome St-Louis <jerome@ecere.com>
Sat, 31 May 2014 17:13:04 +0000 (13:13 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sat, 31 May 2014 17:13:04 +0000 (13:13 -0400)
- From http://www.sqlite.org/pragma.html:
Database locks obtained by a connection in EXCLUSIVE mode may be released either by closing the database connection,
or by setting the locking-mode back to NORMAL using this pragma and then accessing the database file (for read or write).
Simply setting the locking-mode to NORMAL is not enough - locks are not released until the next time the database file is accessed.

eda/drivers/sqlite/EDASQLite.ec

index b845bca..5ec91ed 100644 (file)
@@ -185,6 +185,8 @@ class SQLiteDatabase : Database
    ~SQLiteDatabase()
    {
       sqlite3_exec(db, "PRAGMA locking_mode=normal", null, null, null);
+      // "Simply setting the locking-mode to NORMAL is not enough - locks are not released until the next time the database file is accessed."
+      sqlite3_exec(db, "SELECT COUNT(*) from eda_table_fields", null, null, null);
       sqlite3_close(db);
    }