Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to close the server properly?

 
Liang Anmian
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am now encountering a little issue here. My application architecture is very similar to almost anybody else's. I host a connection factory at the server. If a client wants to get a DB connection, they have to obtain the remote connection factory object and call createDBConnection(). This method will return an object of type DBConnection (a remote interface).

However, doesn't this approach mean that I will need some way of tracking all the DBConnection objects that are created? What if the admin wants to stop the server? This will only stop the connection factory, but NOT the DBConnection objects. Do I need to store a list of all the DBConnection objects created, and close them as well?
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Liang,

I use the follow strategy :
1.I wait until all the client s are done with them tasks
2.I start the shotdown process
3.If a client tries to connect an exception raises.

I hope this help.

Regards,
Mihai.
 
Liang Anmian
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't quite understand what you meant. What I'm encountering now is that I need a way to close all remote database connections if I initiate a shutdown. Currently, it stops the connection factory, but doesn't stop existing connections.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic