File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes Are Remote Objects Thread Safe Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Are Remote Objects Thread Safe " Watch "Are Remote Objects Thread Safe " New topic
Author

Are Remote Objects Thread Safe

Jamshed Dastur
Greenhorn

Joined: Mar 19, 2001
Posts: 7
HI
could anyone tell me if the instance variables of remote objecte in (rmi) thread safe
ie if 2 cleints symultaneously invoke a method of the object
will the requests be queued or will they be threaded ??
Mark Savory
Ranch Hand

Joined: Feb 08, 2001
Posts: 122
What type of remote object are you talking about? session ejb, entity ejb, CORBA object, rmi object..?
Brett Spell
Ranch Hand

Joined: Feb 24, 2001
Posts: 54
Jamshed,
Here's a link to the relevant section of the RMI specification:
http://java.sun.com/j2se/1.3/docs/guide/rmi/spec/rmi-arch3.html
Basically what it says is that multiple calls may or may not execute in a single thread, and that you're responsible for ensuring the thread safety of your code. So in other words, no, accessing instance variables within a method called remotely is not inherently thread-safe.
------------------
Brett Spell
Author, Professional Java Programming


Brett Spell<BR>Author, <B><A HREF="http://www.amazon.com/exec/obidos/ASIN/186100382X/ref=ase_electricporkchop/105-8609264-3147921" TARGET=_blank rel="nofollow">Professional Java Programming</A></B>
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Are Remote Objects Thread Safe
 
Similar Threads
vetor thread safe?
thread safe
threadsafe objects
question from the jweb+
Question regarding rmi server