On 8/18/07, Scott Derrick <[EMAIL PROTECTED]> wrote:
> I have a process that repeatedly, once a second,  inserts data into the
> database.
>
> I open the database, on the class instantiation.
>
> once a second I call a function that;
>
> exec a "BEGIN IMMEDIATE", with a sleep loop if I can't acquire the
> reserved lock.
>
> Then prepare,  step, finalize, exit the function
>
> When I come back into the function and exec a "BEGIN IMMEDIATE" I get an
> error
>
> "Cannot start a transaction within a transaction".
>
> Whats wrong?  Doesn't sqlite3_finalize(stmt),  release the locks,
> deletes the prepared statement and causes the database to be updated?

No, your assumptions are wrong, that's not it's job.
If it did then you couldn't have more than a single statement inside a
transaction, don't you think?

> Why does the engine think I'm still in a transaction?

You didn't end the transaction with either "COMMIT"/"END" or "ROLLBACK".

Regards,
~Nuno Lucas

> thanks,
>
> Scott

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to