I saw that DRH had added the following comment to the ticket:

"2009-Oct-20 16:49:55 by drh: 
When ever a prepared statement runs, it first checks to see if the schema has 
changed. If the schema has changed, then the statement must be recompiled and 
retried. This loop of checking for schema changes and recompiling is run 5 
times, after which statement execution is abandoned with an error.
What appears to be happening in this ticket is that one thread keeps trying to 
run a prepared statement, but the schema keeps getting changed out from under 
it by another thread. Each time the original thread reprepares its statement, 
another thread changes the schema yet again before the first thread has an 
opportunity to run the statement.

If the attached test program is modified so that the statement is retried even 
if it returns SQLITE_ERROR (in addition to SQLITE_SCHEMA and other values) then 
it works as desired.

So, in other words, this appears to be an application problem."


Retrying on SQLITE_ERROR does indeed work in my test case. However I was under 
the impression that SQLITE_ERROR implied a serious error - should my 
application always retry on SQLITE_ERROR returned from sqlite3_exec() or 
sqlite3_step()? Wouldn't SQLITE_SCHEMA be the more appropriate error code in 
this case?

Cheers,
Dave.


-----Original Message-----
From: Roger Binns [mailto:rog...@rogerbinns.com]
Sent: Tue 10/20/2009 6:19 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Ticket 3810: SQLITE_ERROR on concurrent CREATE TEMP 
TRIGGER and sqlite3_close()
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave Toll wrote:
> Could you point me to the test case you referred to?

Look near the bottom of the ticket where it lists the various checkins.
[6955] is the test case.  You can examine the current source in case that
has changed at http://sqlite.org/src/dir

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrd8TYACgkQmOOfHg372QQmLgCffJjKBUwjZ6uND78KbHe7fuWq
kGsAoM993+BlkjyBMeACJBYQapF0lQBV
=/txR
-----END PGP SIGNATURE-----


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

Reply via email to