Forums Register Login

Disconnecting an RMI Server

+Pie Number of slices to send: Send
My RMI Server has a reference to my Remote implementation which contains the database reference. I want to stop my server without shutting down the server application, and be able to start the server again perhaps with a different database file location.

Should I do this by just setting my remote implementation reference to null? I imagine that would kill any open connections to any clients. Does that sound right, or is there a better way?

Thanks for any input.
+Pie Number of slices to send: Send
Hi David,

I believe that this is not required for certification, so you might be better leaving it out.

From my reading of your post, it sounds like the remote client will still be able to connect to your server and call your methods while the database is disconnected - presumably you would throw some exception you created at that point to let the client know that the server is temporarily offline.

So (again, from my reading of your post) I think you will not be killing any open connections, but instead you will stop them from performing real operations until the new database is connected.

Of course I could have misread your post.

Regards, Andrew
+Pie Number of slices to send: Send
Hi Andrew,
Thanks for your reply. Yes I have decided to leave this functionality out. Once the server is started, the user can kill it by pressing ctrl-c at the command prompt. That should be sufficient.

But you brought up a good point - that if the server is down, or rather if the database connection the server has is down, then the clients accessing the server must be notified that this is the case whenever they request data from the server. Good point. I hadn't thought of that. Thanks.
What a stench! Central nervous system shutting down. Save yourself tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 821 times.
Similar Threads
URLY bird, Exception handling problem
Re-Connect feature on client side.
Passed SCJD!!!
My RMI client consists of a Java command-line app
RMI - Client code, Remote Interface and Data class - Classpath or Codebase?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:49:14.