• Post Reply Bookmark Topic Watch Topic
  • New Topic

NX: Closing DB

 
Chris Harris
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Happy New Year.
I have written the DB section that opens the file on start up but does not actually close it. I am relaying on the virtual machine to close the file when the application finishes.
Am I likely to lose marks for not closing the file?
Thanks
Chris.
 
james airey
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would think that you ought to at least make sure that you don't lose any info when the application is switched off and back on again (in a controlled manner). That would be my minimum requirement.
 
Chris Harris
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would it be safe to create a shutdown hook that closes the file when the application termiantes. Or would it just be better to close the file after each read and write?
Thanks
Chris.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!