Hi,
I have this problem - that keeps hunting me.
I use SQLite 3.3.5 - with all queries, updates and inserts in
transactions. I use my own global locking-mechanism, so only one
connection can be opened at one time.
However, I keep getting 'library routine called out of sequence' at
random interval.
The most used transaction does the following:
1) BEGIN TRANSACTION
2) UPDATE
3) If UPDATE returned 0 affected rows - do an INSERT
4) UPDATE
5) If UPDATE returned 0 affected rows - do an INSERT
6) If more data - return to step 2
7) COMMIT / ROLLBACK
However the SQL sometimes return 'library routine called out of
sequence' - which results in that not even the ROLLBACK can be
submitted, and all the following database transactions return 'database
is locked' because the transaction never committed / rolled back.
I have tried everything by now - changing the transaction to IMMEDIATE,
EXCLUSIVE etc. - tried to check for BUSY, increased busy-timeout etc. I
have compiled SQLite with threading and without - all to no avail.
I have read somewhere, that if an QUERY / UPDATE / INSERT hasn't
finished this could be the result - but I have tried to check for this -
and even in this case, shouldn't it be possible to do a ROLLBACK ?
Hope somebody has a an idea for solving this issue?
/Michael