Permalink
Browse files

Revert "CDatabase: remember the databases we already updated and don'…

…t check them on every connect/open"

This reverts commit d78c7195cc81babdd048737b412b99a0848f4c7c.
  • Loading branch information...
1 parent 1769c23 commit a80621f6dbb5b1f8fecf1f50688d17b1f524cad2 Jonathan Marshall committed Jul 7, 2012
Showing with 2 additions and 16 deletions.
  1. +0 −9 xbmc/dbwrappers/Database.cpp
  2. +2 −7 xbmc/dbwrappers/Database.h
@@ -31,16 +31,13 @@
#include "utils/URIUtils.h"
#include "mysqldataset.h"
#include "sqlitedataset.h"
-#include "threads/SingleLock.h"
using namespace AUTOPTR;
using namespace dbiplus;
#define MAX_COMPRESS_COUNT 20
-std::map<std::string, bool> CDatabase::m_updated;
-
CDatabase::CDatabase(void)
{
m_openCount = 0;
@@ -440,10 +437,6 @@ bool CDatabase::Connect(const DatabaseSettings &dbSettings, bool create)
bool CDatabase::UpdateVersion(const CStdString &dbName)
{
- CSingleLock lock(m_critSect);
- if (m_updated[dbName])
- return true;
-
int version = 0;
m_pDS->query("SELECT idVersion FROM version\n");
if (m_pDS->num_rows() > 0)
@@ -479,8 +472,6 @@ bool CDatabase::UpdateVersion(const CStdString &dbName)
CLog::Log(LOGERROR, "Can't open the database %s as it is a NEWER version than what we were expecting?", dbName.c_str());
return false;
}
-
- m_updated[dbName] = true;
return true;
}
@@ -21,17 +21,15 @@
*
*/
-#include <map>
-#include <memory>
-
-#include "threads/CriticalSection.h"
#include "utils/StdString.h"
namespace dbiplus {
class Database;
class Dataset;
}
+#include <memory>
+
class DatabaseSettings; // forward
class CDatabase
@@ -141,7 +139,4 @@ class CDatabase
bool m_bMultiWrite; /*!< True if there are any queries in the queue, false otherwise */
unsigned int m_openCount;
-
- CCriticalSection m_critSect;
- static std::map<std::string, bool> m_updated;
};

0 comments on commit a80621f

Please sign in to comment.