Re: [sqlite] threads and database lock

2008-07-29 Thread Sébastien Escudier
Quoting Igor Tandetnik <[EMAIL PROTECTED]>: > How do you think this is applicable? It talks about multiple threads > running statements on the same connection Yes, and this is the first thing I tried, but in that case, the BEGIN EXCLUSIVE; is useless for queries from other threads. > With multipl

Re: [sqlite] threads and database lock

2008-07-29 Thread Igor Tandetnik
"Sébastien Escudier" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > now I tried with two different handle, one in each thread > > In these messages I read : > "with SQLite 3.5, access to each > database connection is serialized. So even though the interface > allows you to have 20 d

Re: [sqlite] threads and database lock

2008-07-29 Thread Sébastien Escudier
now I tried with two different handle, one in each thread (and each thread execute a sqlite3_open), but the insertion fails with : 'database is locked' error. I thought this was handled by sqlite since 3.5 version. http://www.mail-archive.com/sqlite-users@sqlite.org/msg28089.html http://www.mail-ar

Re: [sqlite] threads and database lock

2008-07-28 Thread Sébastien Escudier
Quoting Dan : > Both of your threads are using the same database handle, no? Executing yes > a "BEGIN EXCLUSIVE" would lock out a second database handle. The > database > lock is a property of the database handle, not the thread from which > the "BEGIN EXCLUSIVE" happened to be executed. ok, tha

Re: [sqlite] threads and database lock

2008-07-28 Thread Dan
On Jul 28, 2008, at 10:58 PM, Sébastien Escudier wrote: > Quoting Dan : >> Post the test program and somebody will tell you. > > ok, you can find my test source here : > http://cjoint.com/data/hCr0WHZYHf.htm > and create test.bdd with : CREATE TABLE test(test INTEGER); > > I have this output : >

Re: [sqlite] threads and database lock

2008-07-28 Thread Sébastien Escudier
Quoting Dan : > Post the test program and somebody will tell you. ok, you can find my test source here : http://cjoint.com/data/hCr0WHZYHf.htm and create test.bdd with : CREATE TABLE test(test INTEGER); I have this output : ./base_test sqlite version : 3.5.9 threadsafe = 1 DEBUG : sleep after beg

Re: [sqlite] threads and database lock

2008-07-28 Thread Dan
On Jul 28, 2008, at 10:18 PM, Sébastien Escudier wrote: > > > Hi > > I'd like to test thread safeness, so I created a test program which : > - spawns two threads (let call them R thread and W thread) > - R tread execute BEGIN EXCLUSIVE; and sleep for a long time > - Then W thread tries to write