[sqlite] Locked database

2015-12-28 Thread Cecil Westerhof
2015-12-27 21:51 GMT+01:00 Cecil Westerhof : > invocation), you should use SQLite binding to some real program language > >> (perl, tcl, python,...) instead of sh and sqlite3. > > > ?Well, for just checking if a database is locked I think it is good > enough. But I also wrote a Java program for it

[sqlite] Locked database

2015-12-27 Thread Cecil Westerhof
2015-12-27 18:11 GMT+01:00 Yuriy M. Kaminskiy : > (I know, I'm a bit late for discussion, but...) > > Cecil Westerhof > writes: > > > 2015-12-14 12:40 GMT+01:00 Clemens Ladisch : > > > >> Cecil Westerhof wrote: > >> > I have a crontab job which uses a SQLite database. Sometimes this > database >

[sqlite] Locked database

2015-12-27 Thread Yuriy M. Kaminskiy
(I know, I'm a bit late for discussion, but...) Cecil Westerhof writes: > 2015-12-14 12:40 GMT+01:00 Clemens Ladisch : > >> Cecil Westerhof wrote: >> > I have a crontab job which uses a SQLite database. Sometimes this database >> > is locked because I used SQLite DB Browser, but did not Write or

[sqlite] Locked database

2015-12-27 Thread Simon Slavin
On 27 Dec 2015, at 5:11pm, Yuriy M. Kaminskiy wrote: > (I know, I'm a bit late for discussion, but...) ... but you know the language (script system) the OP was writing in and you understand the problems involved in scripting SQLite. Great post. Simon.

[sqlite] Locked database

2015-12-15 Thread Cecil Westerhof
2015-12-14 15:14 GMT+01:00 Clemens Ladisch : > Cecil Westerhof wrote: > > sqlite3 "${DATABASE}" "begin immediate" 2>/dev/null > > errorCode="${?}" > > if [[ "${errorCode}" -eq 5 ]] ; then > > printf "${DATABASE} is locked\n" > > > > I saw that when it is locked I get back a 5. Is this always t

[sqlite] Locked database

2015-12-14 Thread Clemens Ladisch
Cecil Westerhof wrote: > sqlite3 "${DATABASE}" "begin immediate" 2>/dev/null > errorCode="${?}" > if [[ "${errorCode}" -eq 5 ]] ; then > printf "${DATABASE} is locked\n" > > I saw that when it is locked I get back a 5. Is this always the case? sqlite3 returns the SQLite error code, and 5 indee

[sqlite] Locked database

2015-12-14 Thread Cecil Westerhof
2015-12-14 12:40 GMT+01:00 Clemens Ladisch : > Cecil Westerhof wrote: > > I have a crontab job which uses a SQLite database. Sometimes this > database > > is locked because I used SQLite DB Browser, but did not Write or Revert > > Changes. It looks like that when a database is locked there is a fi

[sqlite] Locked database

2015-12-14 Thread Clemens Ladisch
Cecil Westerhof wrote: > I have a crontab job which uses a SQLite database. Sometimes this database > is locked because I used SQLite DB Browser, but did not Write or Revert > Changes. It looks like that when a database is locked there is a file with > the database name with -journal appended to it

[sqlite] Locked database

2015-12-14 Thread Cecil Westerhof
I have a crontab job which uses a SQLite database. Sometimes this database is locked because I used SQLite DB Browser, but did not Write or Revert Changes. It looks like that when a database is locked there is a file with the database name with -journal appended to it. Can I count on this? Then I c

Re: [sqlite] locked database?

2013-12-13 Thread Nelson, Erik - 2
Richard Hipp wrote: > The first thing I would do is use the sqlite3_next_stmt() interface ( > http://www.sqlite.org/c3ref/next_stmt.html) to double-check that there > were no unreset and unfinalized prepared statements. > That's perfect, exactly what I needed to find the offending statement! Tha

Re: [sqlite] locked database?

2013-12-13 Thread Richard Hipp
On Fri, Dec 13, 2013 at 1:18 PM, Nelson, Erik - 2 < erik.l.nel...@bankofamerica.com> wrote: > In my app that embeds sqlite version 3.7.14, I'm running into a database > locking problem that happens when detaching a database. If I execute > > attach database 'file:dbtest.db?mode=ro' as prism > > t

[sqlite] locked database?

2013-12-13 Thread Nelson, Erik - 2
In my app that embeds sqlite version 3.7.14, I'm running into a database locking problem that happens when detaching a database. If I execute attach database 'file:dbtest.db?mode=ro' as prism the attachment happens okay, but when I execute detach database prism I get the error 'database prism

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

[sqlite] Locked Database Problem

2010-06-19 Thread Martin Sigwald
Hi, I'm running two different processes, both access the same database at given times, without synchronization. In order to handle a simultaneous access, I was testing for the BUSY condition. However, one of the processes is receiving a LOCKED status form SQLITE, resulting in a eternal deadlock. Ac

Re: [sqlite] Locked database problem

2008-06-22 Thread Igor Tandetnik
"Lothar Behrens" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have s question about avoiding locked database errors by closing a > connection in these circumstances. Opening a connection doesn't acquire any locks, and closing doesn't release any. Starting and finishing transact

[sqlite] Locked database problem

2008-06-22 Thread Lothar Behrens
Hi, I have s question about avoiding locked database errors by closing a connection in these circumstances. In my test application this works and I also can see that the related data has been inserted. But in my main application I also close the connection without success. Is it possible, that

RE: [sqlite] Locked database

2007-02-25 Thread RB Smissaert
Thanks; that must be a possibility. Will pass it on in case it happens again. RBS -Original Message- From: Guy Hachlili [mailto:[EMAIL PROTECTED] Sent: 25 February 2007 14:26 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Locked database Hello. At 13:37 2/25/2007 +, you wrote

Re: [sqlite] Locked database

2007-02-25 Thread Guy Hachlili
Hello. At 13:37 2/25/2007 +, you wrote: Came across a situation where it was impossible to delete or rename a SQLite db file even after the application (Excel) that had locked the database was closed. It wasn't me, so I don't have very exact information, but there was a statement to create a

[sqlite] Locked database

2007-02-25 Thread RB Smissaert
Came across a situation where it was impossible to delete or rename a SQLite db file even after the application (Excel) that had locked the database was closed. It wasn't me, so I don't have very exact information, but there was a statement to create a table and to insert data. For some reason this