diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-04 07:53:18 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-04 07:53:18 +0200 |
commit | 9487403a87a93a738955bb9cafd0d12efa295896 (patch) | |
tree | b2660aa0925f1a4f75bc71577b846c5655ee7183 /common | |
parent | 544e08ab379fd53d00009a3400aa530520b65e85 (diff) | |
download | sink-9487403a87a93a738955bb9cafd0d12efa295896.tar.gz sink-9487403a87a93a738955bb9cafd0d12efa295896.zip |
Cleanup
Diffstat (limited to 'common')
-rw-r--r-- | common/storage.h | 1 | ||||
-rw-r--r-- | common/storage/entitystore.cpp | 24 | ||||
-rw-r--r-- | common/storage_lmdb.cpp | 5 |
3 files changed, 0 insertions, 30 deletions
diff --git a/common/storage.h b/common/storage.h index 71e9401..d1dda3e 100644 --- a/common/storage.h +++ b/common/storage.h | |||
@@ -132,7 +132,6 @@ public: | |||
132 | void abort(); | 132 | void abort(); |
133 | 133 | ||
134 | QList<QByteArray> getDatabaseNames() const; | 134 | QList<QByteArray> getDatabaseNames() const; |
135 | bool validateNamedDatabases(); | ||
136 | 135 | ||
137 | NamedDatabase openDatabase(const QByteArray &name = {"default"}, | 136 | NamedDatabase openDatabase(const QByteArray &name = {"default"}, |
138 | const std::function<void(const DataStore::Error &error)> &errorHandler = {}, bool allowDuplicates = false) const; | 137 | const std::function<void(const DataStore::Error &error)> &errorHandler = {}, bool allowDuplicates = false) const; |
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp index 4cb4641..04760f7 100644 --- a/common/storage/entitystore.cpp +++ b/common/storage/entitystore.cpp | |||
@@ -112,7 +112,6 @@ void EntityStore::startTransaction(Sink::Storage::DataStore::AccessMode accessMo | |||
112 | Q_ASSERT(!d->transaction); | 112 | Q_ASSERT(!d->transaction); |
113 | Sink::Storage::DataStore store(Sink::storageLocation(), d->resourceContext.instanceId(), accessMode); | 113 | Sink::Storage::DataStore store(Sink::storageLocation(), d->resourceContext.instanceId(), accessMode); |
114 | d->transaction = store.createTransaction(accessMode); | 114 | d->transaction = store.createTransaction(accessMode); |
115 | Q_ASSERT(d->transaction.validateNamedDatabases()); | ||
116 | } | 115 | } |
117 | 116 | ||
118 | void EntityStore::commitTransaction() | 117 | void EntityStore::commitTransaction() |
@@ -619,29 +618,6 @@ qint64 EntityStore::maxRevision() | |||
619 | return DataStore::maxRevision(d->getTransaction()); | 618 | return DataStore::maxRevision(d->getTransaction()); |
620 | } | 619 | } |
621 | 620 | ||
622 | /* DataStore::Transaction getTransaction() */ | ||
623 | /* { */ | ||
624 | /* Sink::Storage::DataStore::Transaction transaction; */ | ||
625 | /* { */ | ||
626 | /* Sink::Storage::DataStore storage(Sink::storageLocation(), mResourceInstanceIdentifier); */ | ||
627 | /* if (!storage.exists()) { */ | ||
628 | /* //This is not an error if the resource wasn't started before */ | ||
629 | /* SinkLogCtx(d->logCtx) << "Store doesn't exist: " << mResourceInstanceIdentifier; */ | ||
630 | /* return Sink::Storage::DataStore::Transaction(); */ | ||
631 | /* } */ | ||
632 | /* storage.setDefaultErrorHandler([this](const Sink::Storage::DataStore::Error &error) { SinkWarningCtx(d->logCtx) << "Error during query: " << error.store << error.message; }); */ | ||
633 | /* transaction = storage.createTransaction(Sink::Storage::DataStore::ReadOnly); */ | ||
634 | /* } */ | ||
635 | |||
636 | /* //FIXME this is a temporary measure to recover from a failure to open the named databases correctly. */ | ||
637 | /* //Once the actual problem is fixed it will be enough to simply crash if we open the wrong database (which we check in openDatabase already). */ | ||
638 | /* while (!transaction.validateNamedDatabases()) { */ | ||
639 | /* Sink::Storage::DataStore storage(Sink::storageLocation(), mResourceInstanceIdentifier); */ | ||
640 | /* transaction = storage.createTransaction(Sink::Storage::DataStore::ReadOnly); */ | ||
641 | /* } */ | ||
642 | /* return transaction; */ | ||
643 | /* } */ | ||
644 | |||
645 | Sink::Log::Context EntityStore::logContext() const | 621 | Sink::Log::Context EntityStore::logContext() const |
646 | { | 622 | { |
647 | return d->logCtx; | 623 | return d->logCtx; |
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index 18364ea..b5698b1 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -659,11 +659,6 @@ static bool ensureCorrectDb(DataStore::NamedDatabase &database, const QByteArray | |||
659 | return !openedTheWrongDatabase; | 659 | return !openedTheWrongDatabase; |
660 | } | 660 | } |
661 | 661 | ||
662 | bool DataStore::Transaction::validateNamedDatabases() | ||
663 | { | ||
664 | return true; | ||
665 | } | ||
666 | |||
667 | DataStore::NamedDatabase DataStore::Transaction::openDatabase(const QByteArray &db, const std::function<void(const DataStore::Error &error)> &errorHandler, bool allowDuplicates) const | 662 | DataStore::NamedDatabase DataStore::Transaction::openDatabase(const QByteArray &db, const std::function<void(const DataStore::Error &error)> &errorHandler, bool allowDuplicates) const |
668 | { | 663 | { |
669 | if (!d) { | 664 | if (!d) { |