Is there any method available for checking the sqlite DB connectivity without calling
sqlite3_open([writableDBPath UTF8String], &database) == SQLITE_OK
everytime. We end up开发者_运维知识库 in database connection error after 120 continuous clicks.
Please help.
You should call sqlite3_open just once. Then, if open operation was successful, store the database handle somewhere globally (i.e., in a class variable) and then just use that handle everytime you need to make a call to the database.
First, every sqlite3_open must be matched with a sqlite3_close before open is called with a pointer to that handle again. Otherwise you will have resource leaks, which I think you're experiencing.
Second, why are you repeatedly opening it to begin with?
精彩评论