RE: [sqlite] Multithread access to DB

2006-03-21 Thread Drew, Stephen
] Multithread access to DB Sqlite has 3 types of locks, which is weird for me. Could You explain what is a "reserved lock"? Read and read/write (exclusive) locks are apparent. http://www.sqlite.org/capi3ref.html#sqlite3_busy_handler Best Regards, Rafal Rusin TouK Company (www.touk.pl)

Re: [sqlite] Multithread access to DB

2006-03-21 Thread Rafal Rusin
Sqlite has 3 types of locks, which is weird for me. Could You explain what is a "reserved lock"? Read and read/write (exclusive) locks are apparent. http://www.sqlite.org/capi3ref.html#sqlite3_busy_handler Best Regards, Rafal Rusin TouK Company (www.touk.pl)

Re: [sqlite] Multithread access to DB

2006-03-13 Thread Jay Sprenkle
On 3/13/06, Rafal Rusin <[EMAIL PROTECTED]> wrote: > > Maybe you want to call this: > > > > " int sqlite3_busy_timeout(sqlite3*, int ms); > > > > This routine sets a busy handler that sleeps for a while when a table > > is locked. The handler will sleep multiple times until at least "ms" > > m

Re: [sqlite] Multithread access to DB

2006-03-13 Thread Deepak Kaul
I had major problems with multithreaded access to a sqlite database file on an NFS mount. While not exactly your scenerio there might be some similarities. I had to come up with a crazy scheme to allow only one thread to access the sqlite database at a time. See below. I came up with a sch

Re: [sqlite] Multithread access to DB

2006-03-13 Thread Rafal Rusin
> Maybe you want to call this: > > " int sqlite3_busy_timeout(sqlite3*, int ms); > > This routine sets a busy handler that sleeps for a while when a table > is locked. The handler will sleep multiple times until at least "ms" > milliseconds of sleeping have been done. After "ms" milliseconds o

Re: [sqlite] Multithread access to DB

2006-03-13 Thread Jay Sprenkle
On 3/13/06, Rafal Rusin <[EMAIL PROTECTED]> wrote: > Hello, > > I'm having problems with famous multithread bug > "Database is locked". > I tried to work around that with sqlite3_busy_timeout > or busy_handler, but with no success. I had deadlocks. > I was using version 3.3.4 on Debian Linux. > Cou