void IdoMysqlConnection::NewTransaction()
{
+ if (IsPaused())
+ return;
+
#ifdef I2_DEBUG /* I2_DEBUG */
Log(LogDebug, "IdoMysqlConnection")
<< "Scheduling new transaction and finishing async queries.";
void IdoMysqlConnection::ActivateObject(const DbObject::Ptr& dbobj)
{
+ if (IsPaused())
+ return;
+
#ifdef I2_DEBUG /* I2_DEBUG */
Log(LogDebug, "IdoMysqlConnection")
<< "Scheduling object activation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'.";
{
AssertOnWorkQueue();
+ if (IsPaused())
+ return;
+
if (!GetConnected())
return;
void IdoMysqlConnection::DeactivateObject(const DbObject::Ptr& dbobj)
{
+ if (IsPaused())
+ return;
+
#ifdef I2_DEBUG /* I2_DEBUG */
Log(LogDebug, "IdoMysqlConnection")
<< "Scheduling object deactivation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'.";
{
AssertOnWorkQueue();
+ if (IsPaused())
+ return;
+
if (!GetConnected())
return;
void IdoMysqlConnection::ExecuteQuery(const DbQuery& query)
{
+ if (IsPaused())
+ return;
+
ASSERT(query.Category != DbCatInvalid);
#ifdef I2_DEBUG /* I2_DEBUG */
void IdoMysqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& queries)
{
+ if (IsPaused())
+ return;
+
if (queries.empty())
return;
{
AssertOnWorkQueue();
+ if (IsPaused())
+ return;
+
if (!GetConnected())
return;
{
AssertOnWorkQueue();
+ if (IsPaused())
+ return;
+
if (!GetConnected())
return;
void IdoMysqlConnection::CleanUpExecuteQuery(const String& table, const String& time_column, double max_age)
{
+ if (IsPaused())
+ return;
+
#ifdef I2_DEBUG /* I2_DEBUG */
Log(LogDebug, "IdoMysqlConnection")
<< "Rescheduling cleanup query for table '" << table << "' and column '"
{
AssertOnWorkQueue();
+ if (IsPaused())
+ return;
+
if (!GetConnected())
return;
void IdoPgsqlConnection::NewTransaction()
{
+ if (IsPaused())
+ return;
+
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalNewTransaction, this), PriorityHigh, true);
}
void IdoPgsqlConnection::ActivateObject(const DbObject::Ptr& dbobj)
{
+ if (IsPaused())
+ return;
+
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalActivateObject, this, dbobj), PriorityLow);
}
void IdoPgsqlConnection::DeactivateObject(const DbObject::Ptr& dbobj)
{
+ if (IsPaused())
+ return;
+
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalDeactivateObject, this, dbobj), PriorityLow);
}
void IdoPgsqlConnection::ExecuteQuery(const DbQuery& query)
{
+ if (IsPaused())
+ return;
+
ASSERT(query.Category != DbCatInvalid);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, -1), query.Priority, true);
void IdoPgsqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& queries)
{
+ if (IsPaused())
+ return;
+
if (queries.empty())
return;
{
AssertOnWorkQueue();
+ if (IsPaused())
+ return;
+
if (!GetConnected())
return;
{
AssertOnWorkQueue();
+ if (IsPaused())
+ return;
+
if (!GetConnected())
return;
void IdoPgsqlConnection::CleanUpExecuteQuery(const String& table, const String& time_column, double max_age)
{
+ if (IsPaused())
+ return;
+
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalCleanUpExecuteQuery, this, table, time_column, max_age), PriorityLow, true);
}