Multithreading with SQLite and Objective-C
I have a couple of threads and I'm using SQLite for storage. When I'm trying to access the database I'm getting SQLITE_BUSY error.
Is there a way how to fix this problem other than开发者_Python百科 trying at each request ?
You are most likely running in serialized mode. But ... you're probably looking to run in multi-threaded mode instead. Note that you will need a separate database connection in each thread if you go that route.
Here is the link to the documentation goodness: http://www.sqlite.org/threadsafe.html
Ignore my last answer.
You can use the sqlite3_errmsg function to get the error message as string and print it using NSLog or other ways as soon as error occurs to find the more appropriate and proper reason. http://www.sqlite.org/c3ref/errcode.html
You probably seem to be running in to serialization issue; I am not sure where.
精彩评论