On Feb 28, 2009, at 4:27 AM, D. Richard Hipp wrote:
> This is usually an indication that you passed in a database connection
> pointer to sqlite3_prepare() that had previously been closed.  For
> example:
>      sqlite3_close(db);
>      sqlite3_prepare(db, zSql, -1, &pStmt, 0);
> SQLite does *not* return SQLITE_MISUSE when the schema expires.  When
> the schema expires, it returns SQLITE_SCHEMA - a very different
> error.  SQLite will only return SQLITE_MISUSE if you attempt to use
> the SQLite interface in some way that it was not designed to operate.
> SQLITE_MISUSE errors are often probabilistically detected; in other
> words detection of misuse is not guaranteed.

I had this in mind when I was hunting down the bug, but I couldn't see  
any of my code path close the connection prematurely, and so while  
I'll keep an eye on it (as there is always a possible, unexpected, or  
even OS-induced sitution), now I have ruled out two possibilities (not  
using v2, closing connection prematurely), and wonder if there are  
other possible pathes leading to a SQLITE_MISUSE.

The fact that it occurred very rarely also made me wonder if it had to  
do with iPhone's own sqlite or with the some memory management/file  
system particularities of iPhone OS. I doubt it though.

d.





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

Reply via email to