Frank Chang <frankchan...@gmail.com> wrote: > Good morning, If we use the latest version of sqlite, is it possible to > update the same sqlite table using two different Centos/RedHat Linux pthread > threads?
Yes, but not at the same time. > We are using the same database connection on both pthreads but we > always update different rows on each of the two threads. We have run > some tests using the following code and occasionally sqlite3_prepare and > sqlite2_step returns error code 21. Here is the thread function which each > thread runs. Below it, we show the main thread which creates and manages the > worker threads. Thank you. > > ReturnValue=sqlite3_prepare(td->This->Database,"BEGIN",-1,&(td->This->Statement),0); > status = sqlite3_step(td->This->Statement); You get SQLITE_MISUSE (error 21) when you run BEGIN statement on a connection that already has an explicit transaction open. SQLite doesn't support nested transactions. -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users