I am creating an application with sqlite. I am performing all kind of task on the database Insert, Update, Delete, Select
.
For that I open the database every time, Then execute my query using sqlite3_step()
and after the result I use sqlite3_finalize()
and sqlite3_close()
methods. It is working well in most cases. I am not getting when its happening but some times my database gets locked with the same process I follow and some time it works.
I need to unlock database so even in any case my database get locked then I can unlock it or Plz guide me if I can check by code that my database is locked so I can replace my database with the resource database.
I am using webservice too so I don't have issue about data loss. Is it make sense if I replace my database if it get locked or if there is any way to unlock the database.