• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

close the file on the server

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
To shut down my RMI server, the user will have to controle-c.
I want to close the database file, should I use a Runtime.addShutDownHook() or is there a simpler way?
Also, should I make a call to lock(-1) before closing the file or should I shut down the server right away? What if a user is dead, I dont want to make the server wait 15 minutes before it shuts down...
Thanks
/Daniela
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a GUI on the server side to start/stop the server.
i believe lock(-1) is not required towards meeting the requirements of the assignment.
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I want to close the database file, should I use a Runtime.addShutDownHook() or is there a simpler way?
Also, should I make a call to lock(-1) before closing the file or should I shut down the server right away? What if a user is dead, I dont want to make the server wait 15 minutes before it shuts down...


I would say don't bother with graceful server shutdown, or server GUI, or calling lock(-1), or dead users. Those are the bells and whistles that are beyond your requirements and they add nothing to the clarity/reusability of the design. I did none of them, and got a maximum score for my server design. You may want to think how you will implement the close() method (you don't want the remote users to close the database on the server), but nothing extra is required.
Eugene.
[ December 26, 2002: Message edited by: Eugene Kononov ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic