DB connection pool, used by MSqlQuery. Do not use directly. More...
#include <mythdbcon.h>
Public Member Functions | |
| MDBManager (void) | |
| ~MDBManager (void) | |
| void | CloseDatabases (void) |
| void | PurgeIdleConnections (bool leaveOne=false) |
Protected Member Functions | |
| MSqlDatabase * | popConnection (bool reuse) |
| void | pushConnection (MSqlDatabase *db) |
| MSqlDatabase * | getSchedCon (void) |
| MSqlDatabase * | getDDCon (void) |
Private Types | |
| typedef QList< MSqlDatabase * > | DBList |
Private Member Functions | |
| MSqlDatabase * | getStaticCon (MSqlDatabase **dbcon, QString name) |
Private Attributes | |
| QMutex | m_lock |
| QHash< QThread *, DBList > | m_pool |
| QHash< QThread *, MSqlDatabase * > | m_inuse |
| QHash< QThread *, int > | m_inuse_count |
| int | m_nextConnID |
| int | m_connCount |
| MSqlDatabase * | m_schedCon |
| MSqlDatabase * | m_DDCon |
| QHash< QThread *, DBList > | m_static_pool |
Friends | |
| class | MSqlQuery |
DB connection pool, used by MSqlQuery. Do not use directly.
Definition at line 52 of file mythdbcon.h.
typedef QList<MSqlDatabase*> MDBManager::DBList [private] |
Definition at line 73 of file mythdbcon.h.
| MDBManager::MDBManager | ( | void | ) |
Definition at line 246 of file mythdbcon.cpp.
| MDBManager::~MDBManager | ( | void | ) |
Definition at line 255 of file mythdbcon.cpp.
| void MDBManager::CloseDatabases | ( | void | ) |
Definition at line 443 of file mythdbcon.cpp.
Referenced by MPEG2fixup::ReplexStart(), MythContextPrivate::ResetDatabase(), MThread::RunEpilog(), ~MDBManager(), and MythCoreContextPrivate::~MythCoreContextPrivate().
| void MDBManager::PurgeIdleConnections | ( | bool | leaveOne = false |
) |
Definition at line 349 of file mythdbcon.cpp.
Referenced by popConnection(), pushConnection(), MPoolThread::run(), HouseKeeper::RunHouseKeeping(), and DBPurgeHandler::timerEvent().
| MSqlDatabase * MDBManager::popConnection | ( | bool | reuse | ) | [protected] |
Definition at line 271 of file mythdbcon.cpp.
Referenced by MSqlQuery::InitCon(), and MSqlQuery::testDBConnection().
| void MDBManager::pushConnection | ( | MSqlDatabase * | db | ) | [protected] |
Definition at line 321 of file mythdbcon.cpp.
Referenced by MSqlQuery::InitCon(), MSqlQuery::testDBConnection(), and MSqlQuery::~MSqlQuery().
| MSqlDatabase * MDBManager::getSchedCon | ( | void | ) | [protected] |
Definition at line 433 of file mythdbcon.cpp.
Referenced by MSqlQuery::SchedCon().
| MSqlDatabase * MDBManager::getDDCon | ( | void | ) | [protected] |
Definition at line 438 of file mythdbcon.cpp.
Referenced by MSqlQuery::DDCon().
| MSqlDatabase * MDBManager::getStaticCon | ( | MSqlDatabase ** | dbcon, | |
| QString | name | |||
| ) | [private] |
Definition at line 414 of file mythdbcon.cpp.
Referenced by getDDCon(), and getSchedCon().
friend class MSqlQuery [friend] |
Definition at line 54 of file mythdbcon.h.
QMutex MDBManager::m_lock [private] |
Definition at line 72 of file mythdbcon.h.
Referenced by CloseDatabases(), popConnection(), PurgeIdleConnections(), and pushConnection().
QHash<QThread*, DBList> MDBManager::m_pool [private] |
Definition at line 74 of file mythdbcon.h.
Referenced by CloseDatabases(), popConnection(), PurgeIdleConnections(), and pushConnection().
QHash<QThread*, MSqlDatabase*> MDBManager::m_inuse [private] |
Definition at line 76 of file mythdbcon.h.
Referenced by popConnection(), and pushConnection().
QHash<QThread*, int> MDBManager::m_inuse_count [private] |
Definition at line 77 of file mythdbcon.h.
Referenced by popConnection(), and pushConnection().
int MDBManager::m_nextConnID [private] |
Definition at line 80 of file mythdbcon.h.
Referenced by MDBManager(), popConnection(), and PurgeIdleConnections().
int MDBManager::m_connCount [private] |
Definition at line 81 of file mythdbcon.h.
Referenced by CloseDatabases(), MDBManager(), popConnection(), PurgeIdleConnections(), and ~MDBManager().
MSqlDatabase* MDBManager::m_schedCon [private] |
Definition at line 83 of file mythdbcon.h.
Referenced by CloseDatabases(), getSchedCon(), MDBManager(), and ~MDBManager().
MSqlDatabase* MDBManager::m_DDCon [private] |
Definition at line 84 of file mythdbcon.h.
Referenced by CloseDatabases(), getDDCon(), MDBManager(), and ~MDBManager().
QHash<QThread*, DBList> MDBManager::m_static_pool [private] |
Definition at line 85 of file mythdbcon.h.
Referenced by CloseDatabases(), and getStaticCon().
1.6.3