开发者

Dynamic creation of tables in sqlite locks the database?

I am using sqlite database for my application. When i create tables in it dynamically the app works fine for the first time but when I re start the app i can only read the earlier values that i inserted but no new values get inserted. there is nothing wrong with the c开发者_JAVA百科ode all finalize and all related statements are in place.

Any suggestion why it is happening, the sqlite is giving the error that the database is locked.


As many time mentioned:

"Open the database once at the start of your app, then close it in applicationWillTerminate of the AppDelegate. After every exec you will want to do a reset to clear the connection state."

  1. so did you close your database at app quit?
  2. try sqlite3_reset(stmt) befor finalize
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜