I have a iOS app that uses Sqlite3 as the database.
The app is multithreading.
I want to make sure the app doesn’t get SQlite data locks from one thread to another. I think sqlite3_busy_timeout() might be the answer.
My question is where do I put sqlite3_busy_timeout()? I open the connection to sqlite in the appdelegate. Should I put the sqlite3_busy_timeout() right after I open the sqlite connection, or do I need to put in every time I execute data call.
Thanks for all your help.
why not use transactions instead? this will ensure table inserts are done atomically.
BEGIN TRANSACTION;