Nicolas Sebrecht 038a433f69 backport: sqlite: properly serialize operations on the databases
1. There is one database per folder and sqlite requires to serialize the
writings. Instead of locking at LocalStatusSQLiteFolder object level, introduce
a new DatabaseFileLock object which is shared across threads. This fixes the
concurrent writes issues that some users might experience by duplications or
flags restored to the previous state.

2. Close the database only when we are sure no other threads will use the
connection on a *per-file* basis. Previous fix 677afb8d8f4b3d41e38 is wrong
because the same lock is shared for all the databases.

Github-fix: https://github.com/OfflineIMAP/offlineimap/issues/350
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-07-26 02:00:17 +02:00
..
2016-07-22 16:34:04 +02:00
2015-01-08 23:36:19 +01:00
2015-01-07 21:31:43 +01:00
2015-12-28 01:18:16 +01:00
2015-02-10 17:25:00 +01:00