sqlhelper->Transaction();
bool bRet = sqlhelper->m_sqlQuery.exec(strSql1);
if(!bRet)
{
----------------------------这个地方需要加 sqlhelper->Rollback();吗?----------------
QSqlError sqlError = sqlhelper->GetLastQueryError();
::LogError(__FILE__, __LINE__, sqlError.number(), sqlError.text());
return false;
}
bRet = sqlhelper->m_sqlQuery.exec(strSql2);
if(!bRet)
{
sqlhelper->Rollback();
QSqlError sqlError = sqlhelper->GetLastQueryError();
::LogError(__FILE__, __LINE__, sqlError.number(), sqlError.text());
return false;
}
sqlhelper->Commit();
return true;
bool bRet = sqlhelper->m_sqlQuery.exec(strSql1);
if(!bRet)
{
----------------------------这个地方需要加 sqlhelper->Rollback();吗?----------------
QSqlError sqlError = sqlhelper->GetLastQueryError();
::LogError(__FILE__, __LINE__, sqlError.number(), sqlError.text());
return false;
}
bRet = sqlhelper->m_sqlQuery.exec(strSql2);
if(!bRet)
{
sqlhelper->Rollback();
QSqlError sqlError = sqlhelper->GetLastQueryError();
::LogError(__FILE__, __LINE__, sqlError.number(), sqlError.text());
return false;
}
sqlhelper->Commit();
return true;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货