Ken <kennethinbox-sqlite-/[EMAIL PROTECTED]> wrote:
I've been looking at the server.c file. And have started some
testing. I'd like to know if the server.c (single process, single
server thread handling incoming requests) can handle SQL statements
such as Begin TXn and Commit?
From what I've gathered doing a begin exclusive doesnt really seem
to work. I get success on 4 concurrent threads. Then later get a
commit failure indicating "no transaction active"..
Be aware that SQLite doesn't support nested transactions. Suppose you
get a sequence like
BEGIN
BEGIN
COMMIT
COMMIT
First BEGIN starts a transaction. Second is simply ignored. First COMMIT
ends the transaction. Second commit produces the error you quote.
The usual solution is to handle BEGIN and COMMIT statements by
maintaining a counter. Increment it when you see a BEGIN, decrement on
COMMIT. Only actually execute BEGIN statement when counter moves from 0
to 1, and COMMIT when counter moves from 1 to 0.
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------