When to close db connection on android? Every time after your operation finished or after your app exit

后端 未结 4 674
清歌不尽
清歌不尽 2020-12-01 03:56

I have an android application that access local sqlite3 db frequently, for performance consideration so i always keep the connection open. But one of my friends recommended

4条回答
  •  隐瞒了意图╮
    2020-12-01 04:19

    If you are using an in memory database then your data will be discarded when you close the connection.

    A bit of an edge case perhaps, but it just caught me out.

提交回复
热议问题