I was searching the web for links related to my problem . I came across one thread "Sqlite Thread safety"

SQLite requires one connection per thread for threadsafe operation.  If two
or more threads share an SQLite connection, the program might get the error
"library routine called out of sequence" or a corrupted database.


Actually my application first opens sqlite database and then it spawns a thread which would do further writing to it after that the main thread again opens the db. So this way its MORE THAN ONCE CONNECTION in main thread.

is this the reason behind my problem ?

anybody ?

Thanks
Sumit


Sumit Nagpal wrote:

Hi,

My application has one main thread and other thread which is writing into SQLite Database.
I have opened the db at both locations(read only in main thread) without errors.
But, When I try to access DB thru main thread, it says "library routine called out of sequence" for all calls to sqlite_exec()
What can be the reason behind this ?


Thanks
Sumit

Reply via email to