Mr roushan ali <[EMAIL PROTECTED]> wrote:
> Hi All,
>          we are working on a multi-threaded
> application in linux 2.4.20 using sqlite(2.8.13)
> database. we use single database handle for all the
> threads to access the database and the handle is
> protected with mutex. The handle is kept open for the
> lifetime of the application.
> we have kept provision to update the database from
> multiple threads serially.
> 
>    The issue is, if we do a "begin transaction" in one
> thread and "commit transaction" in another thread ,
> then 
> we get the error "database is locked". But if try to
> update the database from multiple thread serially even
> if a transaction is not committed it is successful.
> 
>   Can anyone tell us is it the expected behaviour ?
> 

There are bugs in Linux 2.4 that prevent this from
working correctly.  My understanding is that all
such bugs have been fixed in 2.6 kernels.  (It was
never clear to me that the bug was actually in the
kernel - BTW.  I was thinking it was more likely
to be found in the implementation of pthreads.)

Generally speaking, it is not safe to use the same
SQLite database handle in more than one thread for
SQLite version 2 and Linux version 2.4.
--
D. Richard Hipp   <[EMAIL PROTECTED]>

Reply via email to