Database connections and stopping an RMI server on demand
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Arun_Ramachandra
Posted On:   Wednesday, May 1, 2002 01:41 PM


How can i start and stop an RMI server on demand?



I know that java.rmi.activation gives me the capability of starting an RMI server on demand.



However i want to know what will happen to the database connections which are made by the RMI server when it is stopped.Do they too terminate gracefully?



If not then how can i make it terminate gracefully?

Re: Database connections and stopping an RMI server on demand

Posted By:   Vishnu_Varma  
Posted On:   Monday, May 6, 2002 05:09 PM

also you can register shutdown hook with your rmi server, in which you can release all the database connections. Shutdown hooks are supported jdk1.3 onwards...see the java.lang.Runtime api.
-Vishnu

Re: Database connections and stopping an RMI server on demand

Posted By:   Bob_Lee  
Posted On:   Wednesday, May 1, 2002 02:18 PM

You can implement a programmatic shutdown. Register a remote admin object that has a shutdown() method. The shutdown() method can in turn call a shutdown() method on your business object which will release the database connections. Then the admin object can unbind the instances from the rmiregistry.
About | Sitemap | Contact