1 #ifndef _ithreaddatabase_
\r
2 #define _ithreaddatabase_
\r
4 #include "db/sqlite3db.h"
\r
6 // each thread using the database must inherit from this class
\r
7 class IThreadDatabase
\r
10 IThreadDatabase():m_db(0) {}
\r
11 virtual ~IThreadDatabase()
\r
22 m_db=new SQLite3DB::DB("fms.db3");
\r
23 m_db->SetBusyTimeout(40000); // set timeout to 40 seconds
\r
24 m_db->Execute("PRAGMA synchronous = FULL;");
\r
26 // MessageInserter will insert a record into this temp table which the MessageListInserter will query for and insert a MessageList when needed
\r
27 m_db->Execute("CREATE TEMPORARY TABLE IF NOT EXISTS tmpMessageListInsert(\
\r
28 MessageListInsertID INTEGER PRIMARY KEY,\
\r
29 LocalIdentityID INTEGER,\
\r
33 // A temporary table that will hold a local identity id of the last identity who was loaded in the trust list page
\r
34 m_db->Execute("CREATE TEMPORARY TABLE IF NOT EXISTS tmpLocalIdentityPeerTrustPage(\
\r
35 LocalIdentityID INTEGER\
\r
38 // Temporary table for form passwords
\r
39 m_db->Execute("CREATE TEMPORARY TABLE IF NOT EXISTS tmpFormPassword(\
\r
47 SQLite3DB::DB *m_db;
\r
50 #endif // _ithreaddatabase_
\r