Merge pull request #397 from microsoft/maharrim/notopen
isOpen() should return true when db is open
This commit is contained in:
Коммит
9a689d586e
|
@ -1 +1 @@
|
|||
Subproject commit b751ddf9312c1bfd48909ede6f93b3f267760e41
|
||||
Subproject commit d1847ca63b5669aa4c0e55c282e1445683eaf289
|
|
@ -10,9 +10,6 @@
|
|||
#include <numeric>
|
||||
#include <set>
|
||||
|
||||
|
||||
#define IF_CLOSED_RETURN if (!isOpen()) return
|
||||
|
||||
namespace ARIASDK_NS_BEGIN {
|
||||
|
||||
class DbTransaction {
|
||||
|
@ -52,7 +49,7 @@ namespace ARIASDK_NS_BEGIN {
|
|||
m_observer->OnStorageFailed("Database is not open");
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
OfflineStorage_SQLite::OfflineStorage_SQLite(ILogManager & logManager, IRuntimeConfig& runtimeConfig, bool inMemory)
|
||||
|
@ -328,7 +325,9 @@ namespace ARIASDK_NS_BEGIN {
|
|||
std::vector<StorageRecord> records;
|
||||
StorageRecord record;
|
||||
|
||||
IF_CLOSED_RETURN records;
|
||||
if (!isOpen()) {
|
||||
return records;
|
||||
}
|
||||
|
||||
if (shutdown)
|
||||
{
|
||||
|
@ -364,7 +363,9 @@ namespace ARIASDK_NS_BEGIN {
|
|||
void OfflineStorage_SQLite::DeleteRecords(const std::map<std::string, std::string> & whereFilter)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(whereFilter);
|
||||
IF_CLOSED_RETURN;
|
||||
if (!isOpen()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOCKGUARD(m_lock);
|
||||
{
|
||||
|
@ -565,7 +566,10 @@ namespace ARIASDK_NS_BEGIN {
|
|||
return result;
|
||||
}
|
||||
|
||||
IF_CLOSED_RETURN result;
|
||||
if (!isOpen()) {
|
||||
LOG_ERROR("Oddly closed");
|
||||
return result;
|
||||
}
|
||||
{
|
||||
#ifdef ENABLE_LOCKING
|
||||
DbTransaction transaction(m_db.get());
|
||||
|
|
Загрузка…
Ссылка в новой задаче