views:

31

answers:

1

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?

+4  A: 

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.
Johannes Rudolph