Question

I am using an embedded database file, on start up of my app, i will open the database file, only when the app exit, i close the database file, is it a best practice?

should i use it the traditional open-update-close fashion?

Was it helpful?

Solution

There's nothing wrong with this approach as long as:

  • the database isn't shared
  • keeping an connection open does not require significant resources
  • you can safely release any allocated resources when your application crashes or terminates unexpectedly.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top