unclear about synchronization requirements in UnicasteRemoteObject

"Dean, Michael" <[email protected]> Wed, 11 Oct 2006 14:52:29 -0700
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
 

 

After reading the JDK 1.2 and 1.1 RMI specs, I remain unclear about
thread-safety in a RMI/JRMP implementation.

 

 

This is my first experience with RMI...here are the facts:

 

We have an sub-class of UnicasteRemoteObject called RMIServlet which
implements the remote interface RMIProxy

 

This is bound to a port 8080.

 

It has the following global variables (only):

 

Private ServerProxyCMPHome proxyHome = null;  // session EJB

Private AclPolicy securityPolicy = null;

Private SessionTrackerData sessionData = null;

Private UserData userData= null;

 

All other variables are local to methods.

 

Now, my understanding is that the calls to the various remote interface
methods are thread-safe (either because of the local variables or
because RMI client connections are single-threaded or both )

 

 

Q's:

1.       Is it true, then, that  the only potential source of problems
would be if two separate threads in two different methods modify one of
the global variables?...Thus all acces to the global variables should be
synchronized?

 

2.      One of the weird things in this implementation: when the user
calls authenticate() on the remote object (RMIServlet) , it returns a
new instance of the RMIServlet to the client  but doesn't bind/rebind
these new instances to any port.  What would be the intent of doing
this?  Are there potential problems?

 

 

We have weird, episodic bug and I'm trying to eliminate potential
sources systematcially

 

 

Michael Dean

Senior Developer

JIS Applications Maintenance

Information Services Division

Administrative Office of the Courts

360.704.4008

[email protected]

 


===========================================================================
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