本文整理汇总了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
}
示例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
}
示例3: ProcessRequests
void SqlDelayThread::ProcessRequests()
{
SqlOperation* s = NULL;
while (m_sqlQueue.next(s))
{
s->Execute(m_dbConnection);
delete s;
}
}
示例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();
}
示例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
}