diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-27 22:19:21 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-27 22:50:23 +0100 |
commit | 1b31818b3cd48be19e2e29eefe91ecec2cbb69e2 (patch) | |
tree | 1c245ae319dc8b99ed62e04d4f1b2f6cc399de24 /common/storage/entitystore.cpp | |
parent | c51f447a476b1f5c3781bcea0ad19e969ba7564e (diff) | |
download | sink-1b31818b3cd48be19e2e29eefe91ecec2cbb69e2.tar.gz sink-1b31818b3cd48be19e2e29eefe91ecec2cbb69e2.zip |
Make opening dbis non-racy
Dbis can only be opened by one thread and should then
be shared accross all threads after committing the transaction
to create the dbi.
This requires us to initially open all db's, which in turn requires us
to know the correct flags.
This patch stores the flags to open each db in a separate db,
and then opens up all databases on initial start.
If a new database is created that dbi is as well shared as soon as
the transaction is committed (before the dbi is private to the
transaction).
Diffstat (limited to 'common/storage/entitystore.cpp')
-rw-r--r-- | common/storage/entitystore.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp index 9156dd4..909f1b2 100644 --- a/common/storage/entitystore.cpp +++ b/common/storage/entitystore.cpp | |||
@@ -59,7 +59,6 @@ public: | |||
59 | 59 | ||
60 | Sink::Storage::DataStore store(Sink::storageLocation(), resourceContext.instanceId(), DataStore::ReadOnly); | 60 | Sink::Storage::DataStore store(Sink::storageLocation(), resourceContext.instanceId(), DataStore::ReadOnly); |
61 | transaction = store.createTransaction(DataStore::ReadOnly); | 61 | transaction = store.createTransaction(DataStore::ReadOnly); |
62 | Q_ASSERT(transaction.validateNamedDatabases()); | ||
63 | return transaction; | 62 | return transaction; |
64 | } | 63 | } |
65 | 64 | ||