I got it from http://www.sqlite.org/cvstrac/wiki?p=DatabaseIsLocked

"Note that an SQLITE_LOCKED error is distinct from SQLITE_BUSY (5). SQLITE_BUSY 
means that another database connection (probably in another process) is using 
the database in a way that prevents you from using it. SQLITE_LOCKED means the 
source of contention is internal and comes from the same database connection 
that received the SQLITE_LOCKED error."

Still the error codes and their equivalent messages are using confusing word 
choices

It would make sense to either have:
SQLITE_BUSY "database is busy."
SQLITE_LOCKED "database table is locked."

OR

SQLITE_LOCKED "database is locked."
SQLITE_TABLE_LOCKED "database table is locked."


-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Pavel Ivanov
Sent: Wednesday, May 23, 2012 1:23 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Feature Request: Change busy error message

> SQLITE_LOCKED implies that the contention is on the same connection

Where did you get this from? Nothing can prevent execution of several 
statements on the same connection.

AFAIK, SQLITE_LOCKED implies that contention is from another connection using 
the same shared database cache. And it can be handled either via a busy handler 
just like SQLITE_BUSY or via sqlite3_unlock_notify().


Pavel


On Wed, May 23, 2012 at 12:39 PM, Shaun Seckman (Firaxis) 
<shaun.seck...@firaxis.com> wrote:
> The two errors SQLITE_BUSY and SQLITE_LOCKED are very similar but also 
> very different.  SQLITE_LOCKED implies that the contention is on the 
> same connection whereas SQLITE_BUSY implies that the contention is 
> from another connection and can be handled via a busy handler.
>
>
>
> The error message reported from sqlite3_errmsg is very deceiving 
> though...
>
>
>
> SQLITE_BUSY -> "database is locked."
>
> SQLITE_LOCKED -> "database table is locked."
>
>
>
> For days now, I kept receiving a "database is locked." error in my 
> logs thinking the contention was due to a single connection only to 
> just now realize the error code was indeed SQLITE_BUSY.
>
>
>
> Can we instead change the error message to read:
>
> SQLITE_BUSY -> "database is busy."
>
> SQLITE_LOCKED -> "database table is locked"
>
>
>
> -Shaun
>
>
>
>
>
> Shaun Seckman
>
> Firaxis Games
> Programmer
>
>
>
> _______________________________________________
> 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
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to