Re: [sqlite] Re: database locked

2006-08-22 Thread Laura Longo
Do you have the 'fuser' command in your flavor of linux/unix? http://linux.about.com/library/cmd/blcmdl1_fuser.htm Yes! Could this help? Sorry for this stupid question, I've read the man pages... it's a wonderful command! Thank you Jay! Laura

Re: [sqlite] Re: database locked

2006-08-22 Thread Jay Sprenkle
On 8/22/06, Laura Longo <[EMAIL PROTECTED]> wrote: > Do you have the 'fuser' command in your flavor of linux/unix? > > http://linux.about.com/library/cmd/blcmdl1_fuser.htm > Yes! Could this help? If some other program has the file open it will tell you. When you get a lockup use it to figure

Re: [sqlite] Re: database locked

2006-08-22 Thread Laura Longo
Do you have the 'fuser' command in your flavor of linux/unix? http://linux.about.com/library/cmd/blcmdl1_fuser.htm Yes! Could this help? - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] Re: database locked

2006-08-22 Thread Jay Sprenkle
In the source code at the begin of the two processes that execute queries on the database I've used the code: srand(time(NULL)); to avoid collisions... (I never started the two processes at the same instant) That should work great. >> >>

Re: [sqlite] Re: database locked

2006-08-22 Thread Laura Longo
- Original Message - From: "Jay Sprenkle" <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Tuesday, August 22, 2006 6:06 PM Subject: Re: [sqlite] Re: database locked On 8/22/06, Christian Smith <[EMAIL PROTECTED]> wrote: Laura Longo uttered: &g

Re: [sqlite] Re: database locked

2006-08-22 Thread Rob Sciuk
On Tue, 22 Aug 2006, Laura Longo wrote: > Date: Tue, 22 Aug 2006 08:51:34 +0200 > From: Laura Longo <[EMAIL PROTECTED]> > Reply-To: sqlite-users@sqlite.org > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Re: database locked > > > Laura, > > &g

Re: [sqlite] Re: database locked

2006-08-22 Thread Jay Sprenkle
On 8/22/06, Christian Smith <[EMAIL PROTECTED]> wrote: Laura Longo uttered: > > >> On 8/21/06, Laura Longo <[EMAIL PROTECTED]> wrote: >>> I've tried also executing the query "begine exclusive" before the >>> "update", >>> and "commit" to end the entire routine, and the query that now returns

Re: [sqlite] Re: database locked

2006-08-22 Thread Laura Longo
Try using sqlite3_busy_timeout(), to get round the temporary locks if possible. SQLite will retry locked database access until the command either succeeds or times out. http://www.sqlite.org/capi3ref.html#sqlite3_busy_timeout If this does not fix your problem, it is possible that an

Re: [sqlite] Re: database locked

2006-08-22 Thread Christian Smith
Laura Longo uttered: On 8/21/06, Laura Longo <[EMAIL PROTECTED]> wrote: I've tried also executing the query "begine exclusive" before the "update", and "commit" to end the entire routine, and the query that now returns the exit code 5 (database locked) is "begin exclusive", I don't know if

Re: [sqlite] Re: database locked

2006-08-22 Thread Laura Longo
Laura, 'df -h' should give you some hints, or 'showmount'. I run on BSD not Linux, but most unix like OS's will tell you if the mount point is a hard drive or a remote mount, in which case, it will have a hostname:/path instead of a /dev/dsk device file as the device/partition information.

Re: [sqlite] Re: database locked

2006-08-21 Thread Laura Longo
> On 8/21/06, Laura Longo <[EMAIL PROTECTED]> wrote: >> I've tried also executing the query "begine exclusive" before the >> "update", >> and "commit" to end the entire routine, and the query that now returns >> the >> exit code 5 (database locked) is "begin exclusive", I don't know if >> this

Re: [sqlite] Re: database locked

2006-08-21 Thread Rob Sciuk
On Mon, 21 Aug 2006, Laura Longo wrote: > Date: Mon, 21 Aug 2006 20:01:24 +0200 > From: Laura Longo <[EMAIL PROTECTED]> > Reply-To: sqlite-users@sqlite.org > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Re: database locked > > > > > On 8/21/06, L

Re: [sqlite] Re: database locked

2006-08-21 Thread Laura Longo
On 8/21/06, Laura Longo <[EMAIL PROTECTED]> wrote: I've tried also executing the query "begine exclusive" before the "update", and "commit" to end the entire routine, and the query that now returns the exit code 5 (database locked) is "begin exclusive", I don't know if this can be

Re: [sqlite] Re: database locked

2006-08-21 Thread Jay Sprenkle
On 8/21/06, Laura Longo <[EMAIL PROTECTED]> wrote: I've tried also executing the query "begine exclusive" before the "update", and "commit" to end the entire routine, and the query that now returns the exit code 5 (database locked) is "begin exclusive", I don't know if this can be meaningful...

Re: [sqlite] Re: database locked

2006-08-21 Thread Laura Longo
This looks like it should work fine. The only thing that concerns me is this could be a very long loop if something locks the table or there's an error that's not recoverable. It would sit there forever retrying something that will never be fixed. Some operations will cause the database to be

Re: [sqlite] Re: database locked

2006-08-21 Thread Jay Sprenkle
On 8/21/06, Laura Longo <[EMAIL PROTECTED]> wrote: Yes, I use a wrapper around the function sqlite3_get_table which, if the return code if different from 0, retries to execute the query calling again sqlite3_get_table doing a 'while'. Besides, each query is written in a file for debugging

[sqlite] Re: database locked

2006-08-21 Thread Laura Longo
On 8/21/06, Laura Longo <[EMAIL PROTECTED]> wrote: Hi all, I'm a software developer and I'm using sqlite3 for my application in c++. This is the problem I've found: two processes do queries (about 1 query per second) on one database; the 'select' queries don't have any problem, while 'update'