On Thu, 25 Jun 2015 16:41:25 +0000 (UTC), Ch? <el.che.the.man at gmail.com> wrote:
>After using sqlite3_prepare_v2 to prepare "BEGIN TRANSACTION", "END >TRANSACTION", and "ROLLBACK TRANSACTION", the system will fault at a delayed >time when calling sqlite3_step. If I call prepare and step right away, there >is no fault. It runs fine. Thus, if I just execute "BEGIN TRANSACTION", I >have no problem. If I prepare a statement and execute it in the same >function, there is no problem too. The problem occurs when I store a >prepared statement and access it at a later time. In debugging, I checked if >anything was changing the sqlite3_stmt* pointer in-between. There was no >tampering in the program. In fact, I created a SQLiteStatement class that >wrapped the sqlite3_stmt*, initialized it to 0, finalized it when done, and >prevented it from being overwritten with operator overloading the '=' sign. >I did this to ensure the safety of the prepared sqlite3_stmt*. Is there any chance the statement is _step()ped, _finalize()d and then re-used? To be able to use a statement multiple times, it should not be finalized but rather _reset(). >Thank you for your help, >Ch? HTH -- Regards, Kees Nuyt