Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 878443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:46:17+00:00 2026-05-15T11:46:17+00:00

I keep my database open for the life of the app and close it

  • 0

I keep my database open for the life of the app and close it on termination. When iOS 4.0 multitasking puts my app into the background, I save the data but don’t close the database. I believe this means that my app will always eventually get purged from memory without ever properly closing the database (or running finalizing statements).

Everything seems to work fine, but I’m just wondering… is it OK to never close the database properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:46:17+00:00Added an answer on May 15, 2026 at 11:46 am

    I would recommend you close the database cleanly when your app transitions into the background. The reason for this is that your app can be killed by the system in order to preserve resources.

    If this happens, your app doesn’t get a chance to exit cleanly, and instead is sent the SIGKIL signal, halting your app immediately, regardless what state it’s in.

    Closing the database, finalising your statements and committing any changes will ensure that your state and data are safe when/if your app is forcibly quit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm hosting a Yii app on shared-host with some my friend, and keep database
I want to keep backup of my database and import it into different System?
Trying to insert a large audio file into an Oracle 10g database and keep
I have trouble understanding how to properly open and close database sessions efficiently, as
I am using sqlite to access my database, and I keep the connection open
I have this code that should update my access database, but I keep getting
I need to keep a database up-to-date with a playlist's contents. I am using
I'd like to keep my database clean of stale almost-accounts, and I was thinking
I'm looking for a way that I can keep a database in one single
The problem: In my database I keep some account numbers in form: PL83102044760000870200961284 Now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.