In a previous thread about sqlite_schema, I commented that there *is* a case
where
SQLITE_SCHEMA does get raised as an error, although DRH said that this is
not possible in
version 3.x. It turns out that I was wrong. The scenario I described does
raise an error,
but it is not SQLITE_SCHEMA, it is SQLITE_ERROR, and thus it is more
difficult to handle.

in short:

if two processes are accessing the same database, and one modifies the
schema, the other gets
this error on first access.

stranegely, this behavior can not be verified using the command line
program, as it does not
happen there. however, this probably has to do with how this particular
program is using the
API. 

I am using the library via the windows dll, and in this case the
sqlite3_step function will return a value of SQLITE_ERROR when another
process has modified the schema. when I try to retrieve an error description
via sqlite3_errmsg(fdb), I get a message similar to "database schema has
changed", however the error code returned was NOT SQLITE_SCHEMA,but
SQLITE_ERROR. 

Clearly, this creates havoc in a multi-user environment, and my code does
not have a neat way of handling it. Since the error is sqlite_error, the
only indication that a retry would succeed is in the text description, and I
would hate to have to issue retries based on the text content..

DRH, is this fixable ? shall I open a ticket ?

Reply via email to