On 06/26/2013 02:08 PM, Woody Wu wrote:
On Tue, Jun 25, 2013 at 10:21:51PM -0400, Igor Tandetnik wrote:
On 6/25/2013 10:13 PM, Woody Wu wrote:
1. When a exclusive transation started and not yet commit, I found if I
open another connection to the same database and try to access it (using
sqlite3_step), I got the error code SQLITE_MISUSE.  It sounds a little
strange because I thought the error code should be SQLITE_BUSY.  Is that
normal?
You are doing something wrong. Some call failed and you are passing
an invalid handle to a subsequent call, or something like that. That
is what causes SQLITE_MISUSE: the existence of an exclusive
transaction is perhaps the proximate cause of the original failure,
but it's not the direct cause of SQLITE_MISUSE.
Thanks for the analyzing.  After checked, I found it's the prepare_v2
statement, previous to the step statement, returned SQLITE_BUSY.  That
means, a prepare_v2 can even failure if the statement be preparing is an
operation to an exclusive locked database.  Sounds very strange! Is it true?

It is. prepare_v2() sometimes has to read the schema from
the database file. And it cannot if another process has
an exclusive lock.

Dan.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to