Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

bool Impala::Application::VideoExcel::TableDataSourceSqliteDb::OpenDb ( std::string  database,
bool  readonly = true 
) [inline, private]

Definition at line 192 of file TableDataSourceSqliteDb.h.

References DbGetIntProperty(), ILOG_DEBUG, ILOG_ERROR, ILOG_INFO, ILOG_WARN, mReadonly, and mSqlDb.

00193     {
00194         mSqlDb->open(database.c_str());
00195         mReadonly = readonly;
00196         ILOG_INFO("Opening database " << database << "...");
00197         int version = DbGetIntProperty("dbversion");
00198         ILOG_DEBUG("Database version: " << version);
00199         if (version == -1)
00200         {
00201             ILOG_ERROR("Cannot open non-existing database.");
00202             return false;
00203         }
00204 
00205         sqlite3_enable_shared_cache(true);
00206 
00207         if (version != 5)
00208         {
00209             ILOG_WARN("trying to open an incompatible database version.");
00210             return false;
00211         }
00212 
00213         try
00214         {
00215             int rows = mSqlDb->execScalar("select count(*) from cache;");
00216             ILOG_INFO("Database opened, " << rows << " images found.");
00217         }
00218         catch (CppSQLite3Exception& e)
00219         {
00220             ILOG_ERROR("Could not read from cache table.");
00221             return false;
00222         }
00223         return true;
00224     }

Here is the call graph for this function:


Generated on Fri Mar 19 10:52:28 2010 for ImpalaSrc by  doxygen 1.5.1