Re: [sqlite] Problem with SQLITE_BUSY

2013-10-30 Thread Simon Slavin
On 30 Oct 2013, at 2:32am, Normand Mongeau nmong...@theobjects.com wrote: Odd thing is that although I do have a 10 second timeout as soon as C goes into a begin transaction A receives the SQLITE_BUSY error, in other words I don't see any 10 second delay. I'll try increasing the timeout.

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-30 Thread Normand Mongeau
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: October-29-13 6:41 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Problem with SQLITE_BUSY You haven't explained what the second connection in A is doing. My educated guess is, the two connections enter into a deadlock

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-30 Thread Simon Slavin
On 30 Oct 2013, at 1:00pm, Normand Mongeau nmong...@theobjects.com wrote: Could this be related to this: in A, the database connection is created in the main program, but is passed down to a dll that loads another dll that uses the connection to do the writes. Maybe the dll should open its

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-30 Thread Normand Mongeau
Using the straight C API of SQLite. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: October-30-13 9:39 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Problem with SQLITE_BUSY On 30 Oct

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-30 Thread Normand Mongeau
-30-13 9:51 AM To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Problem with SQLITE_BUSY Using the straight C API of SQLite. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: October-30-13 9:39

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-30 Thread Simon Slavin
On 30 Oct 2013, at 4:03pm, Normand Mongeau nmong...@theobjects.com wrote: Well finally found the problem: a forgotten sqlite3_finalize() call. Very disturbing, I'd expect leakage, not the results I was seeing. SQLite has to keep the state of your SELECT available until you tell it you're

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-30 Thread Normand Mongeau
...@sqlite.org] On Behalf Of Simon Slavin Sent: October-30-13 12:07 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Problem with SQLITE_BUSY On 30 Oct 2013, at 4:03pm, Normand Mongeau nmong...@theobjects.com wrote: Well finally found the problem: a forgotten sqlite3_finalize

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-30 Thread Igor Tandetnik
. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: October-30-13 12:07 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Problem with SQLITE_BUSY On 30 Oct 2013, at 4:03pm, Normand Mongeau nmong

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-30 Thread Normand Mongeau
Yep OK. I stand corrected. BTW thanks for your help. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: October-30-13 12:16 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Problem with SQLITE_BUSY

[sqlite] Problem with SQLITE_BUSY

2013-10-29 Thread Normand Mongeau
Hi, I have a situation where I always run into an SQLITE_BUSY error. It's quite involved, here's the high picture: -3 processes (A, B and C) each have a connection to the same db. Everybody has a busy handler set for 5 seconds. -1 of these processes (A) opens more than one connection,

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-29 Thread Igor Tandetnik
You haven't explained what the second connection in A is doing. My educated guess is, the two connections enter into a deadlock. This is possible when at least one connection starts as a reader and later attempts to write (the other could be a straight writer). The scenario goes like this: the

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-29 Thread Simon Slavin
On 29 Oct 2013, at 10:26pm, Normand Mongeau nmong...@theobjects.com wrote: I have a situation where I always run into an SQLITE_BUSY error. Set your timeout to something very large (a million milliseconds ?) and see if the problem just turns into unexpected delays instead of errors. You can

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-29 Thread Normand Mongeau
...@sqlite.org] On Behalf Of Igor Tandetnik Sent: October-29-13 6:41 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Problem with SQLITE_BUSY You haven't explained what the second connection in A is doing. My educated guess is, the two connections enter into a deadlock. This is possible when at least

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-29 Thread Normand Mongeau
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: October-29-13 8:48 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Problem with SQLITE_BUSY On 29 Oct 2013, at 10:26pm, Normand Mongeau nmong...@theobjects.com wrote: I have a situation where I always run

Re: [sqlite] Problem with SQLITE_BUSY

2013-10-29 Thread Igor Tandetnik
On 10/29/2013 10:32 PM, Normand Mongeau wrote: Hmm really? Odd thing is that although I do have a 10 second timeout as soon as C goes into a begin transaction A receives the SQLITE_BUSY error, in other words I don't see any 10 second delay. This, too, is consistent with my diagnosis. When

Re: [sqlite] problem with SQLITE_BUSY

2009-07-05 Thread Wenton Thomas
: Saturday, July 4, 2009 10:03:47 PM Subject: Re: [sqlite] problem with SQLITE_BUSY On Jul 4, 2009, at 8:12 PM, Wenton Thomas wrote: I use prepare statements, and I am sure I finalize all of them. You may be mistaken. sqlite3_next_stmt() will return 0 if all statements really are finalized

[sqlite] problem with SQLITE_BUSY

2009-07-04 Thread Wenton Thomas
Now in my system I used sqlite to manage 2 database file A.db and B.db, and each has a connection handle cA, cB. My operation perform like this: sqlite3_exec( select records from cA) sqlite3_exec(begin transaction); insert all records into cB; sqlite3_exec(commit transaction); All return

Re: [sqlite] problem with SQLITE_BUSY

2009-07-04 Thread freshie2004-sqlite
INTO main.mytable(col1,...colN) SELECT col1,...colN FROM dbA.myothertable COMMIT DETACH dbA sqlite3_close B.db Cheers! From: Wenton Thomas thomas.wen...@yahoo.com To: sqlite-users@sqlite.org Sent: Saturday, 4 July, 2009 7:31:55 PM Subject: [sqlite] problem

Re: [sqlite] problem with SQLITE_BUSY

2009-07-04 Thread Wenton Thomas
sqlite3_exec( select records from cA). From: freshie2004-sql...@yahoo.com.au freshie2004-sql...@yahoo.com.au To: General Discussion of SQLite Database sqlite-users@sqlite.org Sent: Saturday, July 4, 2009 5:57:41 PM Subject: Re: [sqlite] problem with SQLITE_BUSY What

Re: [sqlite] problem with SQLITE_BUSY

2009-07-04 Thread Igor Tandetnik
Wenton Thomas wrote: Now in my system I used sqlite to manage 2 database file A.db and B.db, and each has a connection handle cA, cB. My operation perform like this: sqlite3_exec( select records from cA) sqlite3_exec(begin transaction); insert all records into cB; sqlite3_exec(commit

Re: [sqlite] problem with SQLITE_BUSY

2009-07-04 Thread Wenton Thomas
I use prepare statements, and I am sure I finalize all of them. From: Igor Tandetnik itandet...@mvps.org To: sqlite-users@sqlite.org Sent: Saturday, July 4, 2009 8:44:52 PM Subject: Re: [sqlite] problem with SQLITE_BUSY Wenton Thomas wrote: Now in my

Re: [sqlite] problem with SQLITE_BUSY

2009-07-04 Thread Dan
. From: Igor Tandetnik itandet...@mvps.org To: sqlite-users@sqlite.org Sent: Saturday, July 4, 2009 8:44:52 PM Subject: Re: [sqlite] problem with SQLITE_BUSY Wenton Thomas wrote: Now in my system I used sqlite to manage 2 database file A.db and B.db, and each has a connection