Re: RMI cleanup

Esmond Pitt FACS <[email protected]> Fri, 1 May 2009 16:27:14 +1000
Newsgroups gmane.comp.java.sun.rmi
Organization Melbourne Software Company
Message-ID <20090501062603.WFHN12952.nschwotgx02p.mx.bigpond.com@toshibakx1wgjb>
Whether you call Thread.sleep() or Object.wait() is immaterial. The effect
on the client-side CPU load is identical.

You should be more much discriminating about how you handle different
exceptions. The approach you have is OK for exceptions like
NoSuchObjectException that might actually be fixed by reacquiring the
object, but that's by no means all of them. Some of them, e.g.
java.rmi.UnknownHostException, NotBoundException, StubNotFoundException,
UnexpectedException, AccessException, &c, are just fatal; depending on what
the application throws you, some of its exceptions might be fatal too. 

There's a section in my book
http://www.telekinesis.com.au/wipv3_6/Java.RMI.A21 on the appropriate
strategy for dealing with every RMI exception.

A note for Carl:

> setting the reference to null on the client side won't
affect the server side GC unless there is some serious RMI magic going on
under the hood

Yes it will. The magic concerned is called Distributed Garbage Collection.

Esmond Pitt

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html