Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-28 Thread Greg Janee
2 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY On 02/27/2013 12:49 AM, Greg Janée wrote: > I've instrumented the SQLite source and have found that the error is > occurring at the fcntl call near the end of function unix

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-27 Thread Greg Janée
elk1...@gmail.com] Sent: Tuesday, February 26, 2013 10:32 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY On 02/27/2013 12:49 AM, Greg Janée wrote: I've instrumented the SQLite source and have found that the error is occurring at

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Dan Kennedy
On 02/27/2013 12:49 AM, Greg Janée wrote: I've instrumented the SQLite source and have found that the error is occurring at the fcntl call near the end of function unixLock (in SQLite version 3.7.0.1, this is line 23592 of sqlite3.c). The relevant code snippet is below. fnctl is returning -1, a

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Michael Black
: Tuesday, February 26, 2013 11:50 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY I've instrumented the SQLite source and have found that the error is occurring at the fcntl call near the end of function unixLock (in S

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Simon Slavin
On 26 Feb 2013, at 5:49pm, Greg Janée wrote: > SQLite is being used from a multi-threaded application in my case, and I > don't know if it's a possibility that some other thread is overwriting errno. Yes it is. Change your threading mode and see whether you get a different error, or if the e

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Greg Janée
I've instrumented the SQLite source and have found that the error is occurring at the fcntl call near the end of function unixLock (in SQLite version 3.7.0.1, this is line 23592 of sqlite3.c). The relevant code snippet is below. fnctl is returning -1, and errno=2 (ENOENT). From my readin

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Dan Kennedy
On 02/27/2013 12:00 AM, Greg Janée wrote: errno=2 (ENOENT) What could not be existing? Strange. Could the value of errno have been clobbered before you read it? What can you see if you run the app under "truss -tfcntl"? Dan. On Feb 26, 2013, at 4:01 AM, Dan Kennedy wrote: On 02/26/2013

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Greg Janée
errno=2 (ENOENT) What could not be existing? On Feb 26, 2013, at 4:01 AM, Dan Kennedy wrote: On 02/26/2013 05:22 AM, Greg Janée wrote: I'm accessing an SQLite database from two processes simultaneously. If there's contention, one process will receive an SQLITE_BUSY; that's fine. However, o

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Dan Kennedy
On 02/26/2013 05:22 AM, Greg Janée wrote: I'm accessing an SQLite database from two processes simultaneously. If there's contention, one process will receive an SQLITE_BUSY; that's fine. However, occasionally a process will receive an SQLITE_IOERR with the extended result code SQLITE_IOERR_LOCK

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-25 Thread Greg Janée
Have you set a SQLite timeout of a few seconds ? See here: I was expecting to get SQLITE_BUSY and nothing else. If the _BUSY state lasts for longer than the timeout you've set, then you'll get _IOERR. Setting a long timeout gives the softwar

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-25 Thread Simon Slavin
On 25 Feb 2013, at 10:22pm, Greg Janée wrote: > I'm accessing an SQLite database from two processes simultaneously. If > there's contention, one process will receive an SQLITE_BUSY; that's fine. > However, occasionally a process will receive an SQLITE_IOERR with the > extended result code S

[sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-25 Thread Greg Janée
I'm accessing an SQLite database from two processes simultaneously. If there's contention, one process will receive an SQLITE_BUSY; that's fine. However, occasionally a process will receive an SQLITE_IOERR with the extended result code SQLITE_IOERR_LOCK. This seems to occur if the other