Re: [sqlite] Sqlite locking issue with ATTACH'ed databases

2013-07-23 Thread Loren Keagle
I've narrowed this locking issue down to a very simply test case. It seems as though having the same file attached multiple times with different names prevents exclusive or immediate transactions from acquiring a lock. Deferred transactions still seem to work fine. Try the following code:

Re: [sqlite] Sqlite locking issue with ATTACH'ed databases

2013-07-19 Thread Israel Lins Albuquerque
Wed, 17 Jul 2013 17:21:15 +0100 >> From: Simon Slavin <slav...@bigfraud.org> >> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> >> Subject: Re: [sqlite] Sqlite locking issue with ATTACH'ed databases >> Message-ID: <f0ad438b-1165-419d-99

Re: [sqlite] Sqlite locking issue with ATTACH'ed databases

2013-07-19 Thread Simon Slavin
On 18 Jul 2013, at 8:26pm, Loren Keagle wrote: > It definitely seems to be related to having the same database attached > multiple times with different names. Okay. I have absolutely no idea how well SQLite copes with that. I'm not saying it's bad, I just have

Re: [sqlite] Sqlite locking issue with ATTACH'ed databases

2013-07-19 Thread Loren Keagle
>Date: Wed, 17 Jul 2013 17:21:15 +0100 >From: Simon Slavin <slav...@bigfraud.org> >To: General Discussion of SQLite Database <sqlite-users@sqlite.org> >Subject: Re: [sqlite] Sqlite locking issue with ATTACH'ed databases >Message-ID: <f0ad438b-1165-419d-99bf-57faf9de5.

Re: [sqlite] Sqlite locking issue with ATTACH'ed databases

2013-07-17 Thread Patrik Nilsson
>> Prepare query statement; >> Iterate through one or more rows; >> Reset statement; >> >> Attempt to begin transaction; <--- SQLITE_BUSY "The sqlite3_reset() function is called to reset a prepared statement object back to its initial state, ready to be re-executed. Any SQL statement

Re: [sqlite] Sqlite locking issue with ATTACH'ed databases

2013-07-17 Thread Dušan Paulovič
If you remove a busy check, does it output any statements? Do you have any custom functions/operations running so they could block sqlite in creating new statement? 2013/7/17 Loren Keagle > Hi everyone, > > I have an interesting locking problem that I'm wondering

Re: [sqlite] Sqlite locking issue with ATTACH'ed databases

2013-07-17 Thread Simon Slavin
On 16 Jul 2013, at 11:24pm, Loren Keagle wrote: > Begin EXCLUSIVE TRANSACTION; > insert several rows of data; > Commit transaction; > > Prepare query statement; > Iterate through one or more rows; > Reset statement; > > Attempt to begin transaction; <---

[sqlite] Sqlite locking issue with ATTACH'ed databases

2013-07-17 Thread Loren Keagle
Hi everyone, I have an interesting locking problem that I'm wondering if someone can help with some insight. I have a master database with some metadata, and several sub-databases to store logging events. I have one reader object and one writer object that attach to the sub-databases and