aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: Force restart when DB location changed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX: Force restart when DB location changed" Watch "NX: Force restart when DB location changed" New topic
Author

NX: Force restart when DB location changed

Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
As you guys know with the new exam all config is in a props file, to display the config I have a seperate view so that I can use it outside of the main view as well.
This works fine so far, if for instance the DB server or standalone GUI cannot be started because DB location could not be found, I simply bring up that view and have the user re-configure if they want to.
My question is though, should I try again to connect immediately, or should I ask the user to re-start, trying again could be convenient but I'm not sure its worth the time, I'd also then have to worry about how many times to try again, or maybe just try until the user quits.
your thoughts please, personally I'm hoping thats enough
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11508
    
  95

Hi Ta Ri Ki,
Personally, I dislike applications that force you to restart every time you change something (the most extreme case is Windows 9x / NT).
So for my application, when the user enters the information needed to connect (either locally or remotely) I try and do a connect and retrieve the initial data. If the connect fails, or if the initial data load fails then the user gets an error dialog informing them of what is wrong, and giving a possible solution. They are then returned to the panel where they can enter correct information or quit.
Why do I also try and retrieve initial data? Simple: If you start your server, which registers with the RMI Registry, then kill the server without allowing it to unregister, then there is a window where a client can connect to the registry, and get what appears (to the client app) to be a valid connection to the server even though the server is not running.
Once I had done this, I saw how easy it would be to allow the user to change connections mid way through, so I added that functionality and tested it. Outside of scope, but I think it makes it a bit nicer.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
frank sun
Ranch Hand

Joined: Apr 11, 2003
Posts: 102
Hi,TQ
I don't seperate the configure window from the user operation(Main view), the user can open the configure window anytime he wants to, of course, in server mode, if server can start successully, it won't display, only when the server failed to start, it display the main view, and let the user configure the parameters.
Anyway, after the user complete the configuration, it needs the user exit the application and to restart to activate the new parameters.
FYR.
Frank
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
Thanks guys, I agree with both of you, and I'm sure both approaches will pass, which is making my choice a little harder, and I'd better make that choice soon, thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NX: Force restart when DB location changed