Hey guys, once again thanks for the help.
Should really every single INSERT/UPDATE section have a begin/end
transaction around it?
I have posted this code before, so apologies for doing it again - here
is how my scripting language calls a query:
int SQLiteObject::ExecuteSQL(const char* sql, int hack)
{
int iResult;
sqlite_resultset* pResultSet;
ClearErrorString();
// create a new resultset
pResultSet = new sqlite_resultset;
if (pResultSet)
{
pResultSet->bValid = false;
pResultSet->iCurrentColumn = 0;
pResultSet->iCurrentRow = 0;
pResultSet->iNumCols = 0;
pResultSet->iNumRows = 0;
pResultSet->iResultSet = m_iNextResultSet;
pResultSet->vRows.clear();
m_iLastResultSet = m_iNextResultSet;
m_iNextResultSet++;
}
else
return 0;
iResult = sqlite3_exec(m_pDatabase, sql, Callback,
(void*)pResultSet, &m_szErrorString);
if (iResult == 0)
{
//SQLITE_OK
SaveResultSet(pResultSet);
//Con::executef(this, 1, "onQueryFinished()");
#ifdef PROFILE_DB
Con::errorf("--- NEW DB RESULT SET: %i", pResultSet->iResultSet);
#endif
return pResultSet->iResultSet;
}
else
{
// error occured
Con::executef(this, 2, "onQueryFailed", m_szErrorString);
delete pResultSet;
return 0;
}
return 0;
}
On 03/06/2011 15:28, Black, Michael (IS) wrote:
>
> And do you wrap all your updates inside a transaction?
>
> Michael D. Black
>
> Senior Scientist
>
> NG Information Systems
>
> Advanced Analytics Directorate
>
> ------------------------------------------------------------------------
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users