当前位置: 首页>>代码示例>>C++>>正文


C++ SqlOperation类代码示例

本文整理汇总了C++中SqlOperation的典型用法代码示例。如果您正苦于以下问题:C++ SqlOperation类的具体用法?C++ SqlOperation怎么用?C++ SqlOperation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SqlOperation类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mysql_thread_init

void SqlDelayThread::run()
{
    #ifndef DO_POSTGRESQL
    mysql_thread_init();
    #endif

    const uint32 loopSleepms = 10;

    const uint32 pingEveryLoop = m_dbEngine->GetPingIntervall()/loopSleepms;

    uint32 loopCounter = 0;
    while (m_running)
    {
        // if the running state gets turned off while sleeping
        // empty the queue before exiting

        ACE_Based::Thread::Sleep(loopSleepms);
        SqlOperation* s;
        while (m_sqlQueue.next(s))
        {
            s->Execute(m_dbEngine);
            delete s;
        }
        if((loopCounter++) >= pingEveryLoop)
        {
            loopCounter = 0;
            delete m_dbEngine->Query("SELECT 1");
        }
    }

    #ifndef DO_POSTGRESQL
    mysql_thread_end();
    #endif
}
开发者ID:1ATOM,项目名称:mangos,代码行数:34,代码来源:SqlDelayThread.cpp

示例2: run

void SqlDelayThread::run()
{
    SqlOperation* s;
    #ifndef DO_POSTGRESQL
    mysql_thread_init();
    #endif

    while (m_running)
    {
      try
	{
	  s = m_sqlQueue.next();
	}
      catch(...)
	{continue;}
      if(!s)
	continue;
      s->Execute(m_dbEngine);
      delete s;
    }

    #ifndef DO_POSTGRESQL
    mysql_thread_end();
    #endif
}
开发者ID:Bootz,项目名称:TC-One,代码行数:25,代码来源:SqlDelayThread.cpp

示例3: ProcessRequests

void SqlDelayThread::ProcessRequests()
{
    SqlOperation* s = NULL;
    while (m_sqlQueue.next(s))
    {
        s->Execute(m_dbConnection);
        delete s;
    }
}
开发者ID:MonstermoshCOM,项目名称:server,代码行数:9,代码来源:SqlDelayThread.cpp

示例4: LOCK_DB_CONN

bool SqlTransaction::Execute(SqlConnection *conn)
{
    if (m_queue.empty())
        return true;

    LOCK_DB_CONN(conn);

    conn->BeginTransaction();

    const int nItems = m_queue.size();
    for (int i = 0; i < nItems; ++i)
    {
        SqlOperation * pStmt = m_queue[i];
        if(!pStmt->Execute(conn))
        {
            conn->RollbackTransaction();
            return false;
        }
    }

    return conn->CommitTransaction();
}
开发者ID:Blumfield,项目名称:ptc2,代码行数:22,代码来源:SqlOperations.cpp

示例5: mysql_thread_init

void SqlDelayThread::run()
{
    #ifndef DO_POSTGRESQL
    mysql_thread_init();
    #endif

    while (m_running)
    {
        // if the running state gets turned off while sleeping
        // empty the queue before exiting
        ACE_Based::Thread::Sleep(10);
        SqlOperation* s;
        while (m_sqlQueue.next(s))
        {
            s->Execute(m_dbEngine);
            delete s;
        }
    }

    #ifndef DO_POSTGRESQL
    mysql_thread_end();
    #endif
}
开发者ID:executor,项目名称:riboncore,代码行数:23,代码来源:SqlDelayThread.cpp


注:本文中的SqlOperation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。