To me, a BUSY state would mean that everything up to actually reading or
writing the data out is valid, but, the response time coming back was just
too long, so a timeout hit which might mean that a retry later might be
appropriate.  To me, a timeout = busy, but, locked != busy.  When something
is locked, you're basically denied being able to perform the function for
one reason or another.  If the file or connection is R/O, that'd be a valid
locked error result for write functions.  If the connection was alive, a
write to the database was asked, but it took too long to complete, then,
BUSY would make sense to me.  If the connection was able to send out one
successful write to the database/WAL, but later down the road the
transaction took too long to complete, then maybe a BUSY error back would
be appropriate, but, if the first write failed, then LOCKED might be
appropriate.

If anything was written to the the DB itself, or the journal file, then
during the life of that transaction, if write attempt takes too long, the
result would be BUSY.  If no write was done but took too long, then a
LOCKED error is the error result.

Disclaimer: I've not had my pot of coffee yet, so I might be missing a few
tidbits of information both in what I've written above, as well as the
mental think-through when I wrote it. :]

On Wed, Dec 3, 2014 at 9:23 AM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 3 Dec 2014, at 2:20pm, Stephen Chrzanowski <pontia...@gmail.com> wrote:
>
> > Although I think there is already an error result, one situation might be
> > when the DB is in a read only state.
>
> I just thought of the database /file/ being marked 'read-only'.  But it
> turns out that there's a different SQLite result code for that situation.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to