• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S: Problem with stop server

 
Bodenstab Oliver
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo,

i have a problem with stopping my server.

I've a factory who build the DatabaseImpl object. The Factory has a collection of them. If the Server-Client want to stop the server, it calls Naming.unbind and destroys all items of the collection of DatabasImpl objects by the method below. But the client can work further .
How can i destroy the DatabaseImpl objects and not only the items in the collection?



database = null doesn't work

Thanks for response

Oliver
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11890
203
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Oliver,

Have you considered going about this a totally different way? Instead of trying to stop the client calling a remote method, have your server side methods check if they are supposed to be accepting remote calls. If not, they can either block or throw some exception depending on what you consider to be a good business rule.

When you start to shut down your server, you should probably be locking the database against any write operations - this would be essential before allowing the server to stop (consider what happens if the server stops in the middle of writing a record). Setting some flag to say that remote calls are not being accepted could also be used as a flag to say that writes are no longer allowed.

Regards, Andrew
 
Bodenstab Oliver
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for help.
I think i should go this way.

Oliver
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic