summaryrefslogtreecommitdiffstats
path: root/common/storage_lmdb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/storage_lmdb.cpp')
-rw-r--r--common/storage_lmdb.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp
index fe3b303..f254077 100644
--- a/common/storage_lmdb.cpp
+++ b/common/storage_lmdb.cpp
@@ -222,7 +222,11 @@ public:
222 QReadLocker dbiLocker{&sDbisLock}; 222 QReadLocker dbiLocker{&sDbisLock};
223 if (sDbis.contains(dbiName)) { 223 if (sDbis.contains(dbiName)) {
224 dbi = sDbis.value(dbiName); 224 dbi = sDbis.value(dbiName);
225 Q_ASSERT(dbiValidForTransaction(dbi, transaction)); 225 //sDbis can potentially contain a dbi that is not valid for this transaction, if this transaction was created before the dbi was created.
226 if (!dbiValidForTransaction(dbi, transaction)) {
227 SinkTrace() << "Found dbi that is not available for the current transaction.";
228 return false;
229 }
226 } else { 230 } else {
227 /* 231 /*
228 * Dynamic creation of databases. 232 * Dynamic creation of databases.
@@ -250,7 +254,11 @@ public:
250 //Double checked locking 254 //Double checked locking
251 if (sDbis.contains(dbiName)) { 255 if (sDbis.contains(dbiName)) {
252 dbi = sDbis.value(dbiName); 256 dbi = sDbis.value(dbiName);
253 Q_ASSERT(dbiValidForTransaction(dbi, transaction)); 257 //sDbis can potentially contain a dbi that is not valid for this transaction, if this transaction was created before the dbi was created.
258 if (!dbiValidForTransaction(dbi, transaction)) {
259 SinkTrace() << "Found dbi that is not available for the current transaction.";
260 return false;
261 }
254 return true; 262 return true;
255 } 263 }
256 264