I am using sqlite db for my iOS app. Here i get an error saying 'database is locked' while I am trying to insert a row in a table. I agree there are many questions posted for the same and many solutions and reasons given for the error but mine is not solved with any of those. Reasons being multithreading in sqlite is prohibited, database should be open, finalize should be called etc. I am posting my code to make it more transparent. I am using sqlite db for my iOS app. Here i get