IOS FMDB does not need to be turned off

Source: Internet
Author: User

Used to do an application, the inside used to fmdb, every operation before, all open, after the completion of the operation are close. Because I was referring to their previous code. The program did not find any problems at the beginning, after the completion of the program, a variety of stuttering appeared! Even though I was working on a new thread. After careful examination, it was found that the program used the CPU share on open and close unusually high, especially when the fast operation was tested. Later I found the following post, originally, with the wrong!

Http://stackoverflow.com/questions/15720272/when-to-close-sqlite-database-using-fmdb

The problem is:

When should you close the connection to an SQLite database (using in FMDB)? Right- I am closing it after running every batch of related queries and should I rather close when my app closes
    ? What is the pros/cons of doing either?

The answer is:

I'm the guy whowrote FMDB. Keep it open unless your change your schema. That's the only reason to close it, and constantly re-opening it's a little hits on Performance/batter Y life.

I Don't much IOS programming-so take my answer with a grain of salt. But no, I don ' are inatry out

IOS FMDB does not need to be closed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.