From 9487403a87a93a738955bb9cafd0d12efa295896 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 4 May 2017 07:53:18 +0200 Subject: Cleanup --- common/storage.h | 1 - common/storage/entitystore.cpp | 24 ------------------------ common/storage_lmdb.cpp | 5 ----- 3 files changed, 30 deletions(-) (limited to 'common') 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: void abort(); QList getDatabaseNames() const; - bool validateNamedDatabases(); NamedDatabase openDatabase(const QByteArray &name = {"default"}, const std::function &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 Q_ASSERT(!d->transaction); Sink::Storage::DataStore store(Sink::storageLocation(), d->resourceContext.instanceId(), accessMode); d->transaction = store.createTransaction(accessMode); - Q_ASSERT(d->transaction.validateNamedDatabases()); } void EntityStore::commitTransaction() @@ -619,29 +618,6 @@ qint64 EntityStore::maxRevision() return DataStore::maxRevision(d->getTransaction()); } -/* DataStore::Transaction getTransaction() */ -/* { */ -/* Sink::Storage::DataStore::Transaction transaction; */ -/* { */ -/* Sink::Storage::DataStore storage(Sink::storageLocation(), mResourceInstanceIdentifier); */ -/* if (!storage.exists()) { */ -/* //This is not an error if the resource wasn't started before */ -/* SinkLogCtx(d->logCtx) << "Store doesn't exist: " << mResourceInstanceIdentifier; */ -/* return Sink::Storage::DataStore::Transaction(); */ -/* } */ -/* storage.setDefaultErrorHandler([this](const Sink::Storage::DataStore::Error &error) { SinkWarningCtx(d->logCtx) << "Error during query: " << error.store << error.message; }); */ -/* transaction = storage.createTransaction(Sink::Storage::DataStore::ReadOnly); */ -/* } */ - -/* //FIXME this is a temporary measure to recover from a failure to open the named databases correctly. */ -/* //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). */ -/* while (!transaction.validateNamedDatabases()) { */ -/* Sink::Storage::DataStore storage(Sink::storageLocation(), mResourceInstanceIdentifier); */ -/* transaction = storage.createTransaction(Sink::Storage::DataStore::ReadOnly); */ -/* } */ -/* return transaction; */ -/* } */ - Sink::Log::Context EntityStore::logContext() const { 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 return !openedTheWrongDatabase; } -bool DataStore::Transaction::validateNamedDatabases() -{ - return true; -} - DataStore::NamedDatabase DataStore::Transaction::openDatabase(const QByteArray &db, const std::function &errorHandler, bool allowDuplicates) const { if (!d) { -- cgit v1.2.3