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? > > >2. After started a exclusive transaction with success. Can I expect that > >all the operations that follows should run with success? > > Yes, barring catastrophic failure (e.g. hard drive gone bad) and > programming errors on your part (e.g. trying to prepare a > syntactically incorrect statement). > > >Especially, is that possible that the 'commit' could get an error of > >SQLITE_BUSY? > > No, it is not. > -- Thanks a lot! > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

