Re: [sqlite] Implementing busy-waiting on SQLite

2011-06-14 Thread BareFeetWare
On 13/06/2011, at 6:49 PM, Ian Hardingham wrote: > As was being discussed yesterday, I have four processes accessing the > same database file. When they perform an sqlite action, I wish them to > block if the DB is not available. SQLite does not block if it finds the > db busy or locked, it

Re: [sqlite] Implementing busy-waiting on SQLite

2011-06-13 Thread Jay A. Kreibich
On Mon, Jun 13, 2011 at 06:21:10PM +0200, Jean-Christophe Deschamps scratched on the wall: > Hi Jay, > > >> Invoke sqlite3_busy_timeout() with a safe timeout for every connection > >> to the DB. > >> Use IMMEDIATE transactions everywhere. > >> > >> That's all you have to do. > > > > Well, yes

Re: [sqlite] Implementing busy-waiting on SQLite

2011-06-13 Thread Jean-Christophe Deschamps
Hi Jay, > > Invoke sqlite3_busy_timeout() with a safe timeout for every connection > > to the DB. > > Use IMMEDIATE transactions everywhere. > > > > That's all you have to do. > > Well, yes and no. You still have to deal with the case of > SQLITE_BUSY being returned due to deadlocks.

Re: [sqlite] Implementing busy-waiting on SQLite

2011-06-13 Thread Jay A. Kreibich
On Mon, Jun 13, 2011 at 12:40:14PM +0200, Jean-Christophe Deschamps scratched on the wall: > > >As was being discussed yesterday, I have four processes accessing the > >same database file. When they perform an sqlite action, I wish them to > >block if the DB is not available. SQLite does not

Re: [sqlite] Implementing busy-waiting on SQLite

2011-06-13 Thread Jean-Christophe Deschamps
>As was being discussed yesterday, I have four processes accessing the >same database file. When they perform an sqlite action, I wish them to >block if the DB is not available. SQLite does not block if it finds the >db busy or locked, it returns an error code. You can have SQLite do all this

[sqlite] Implementing busy-waiting on SQLite

2011-06-13 Thread Ian Hardingham
Hey guys. As was being discussed yesterday, I have four processes accessing the same database file. When they perform an sqlite action, I wish them to block if the DB is not available. SQLite does not block if it finds the db busy or locked, it returns an error code. I plan on using