I'm back again. I could not ignore such a strong suggestion of not using thread. So I am planning on a single threaded event driven model for my application. I also plan to use sqlite3_progress_handler() to handle query cancellation.
I compiled SQLite with the flags SQLITE_THREADSAFE=0. Even then, do I need to link my application with pthread library? I get linking errors like: sqlite3.c:(.text+0x1c737): undefined reference to 'pthread_mutex_trylock' ... Thanks, dbikash D. Richard Hipp wrote: > > > On Nov 3, 2008, at 9:54 AM, Ken wrote: > >> No I would not wrap the querries in a transaction. >> >> I think the problem you are encountering is due to thread >> interaction upon the sqlite structures. Since it was compiled with >> THREADsafety disabled. >> >> If you have two threads that share the same connection. You need to >> compile with THREADSAFE turned on. Or provide your own mutexing such >> that neither thread interacts with the sqlite connection concurrently. > > Note: when SQLITE_THREADSAFE=0 then it is not safe for two threads to > call SQLite under any circumstances, even if they are using completely > separate database connections. > > My advice is that you not use threads. Threads are evil. But, > recognizing that you are unlikely to heed this warning, at the very > least compile with SQLITE_THREADSAFE=1 if you really think you must > use threads. > > D. Richard Hipp > [EMAIL PROTECTED] > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- View this message in context: http://www.nabble.com/%22SQL-logic-error-or-missing-database%22-with-multithreaded-program-tp20266281p20355543.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users