Matt Wilson wrote:
I have two statements in one process

statement 1                        statement 2
-----------                        -----------
prepare("select * from foo")
step() == SQLITE_ROW
                                   prepare("insert into foo values(1)"
                                   step() == SQLITE_ERROR

I would expect for sqlite3_busy_timeout(db, 30000); to make the step()
on statement 2 wait 30 seconds before returning, but it returns
immediately.  Is this the correct behavior?  Also, I would expect for
the return code of the sqlite3_step() on statement 2 to be
SQLITE_LOCKED, not SQLITE_ERROR.


You are trying to execute both statements from the same connection, the same sqlite3_open(). You can do that, but the rules are different. Locking works differently. And you never, ever get busy callbacks or timeouts.

If you do separate sqlite3_open() calls for each statement,
the behavior will be more along the lines of what you expect.



--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565



Reply via email to