• Post Reply Bookmark Topic Watch Topic
  • New Topic

Are Remote Objects Thread Safe

 
Jamshed Dastur
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What type of remote object are you talking about? session ejb, entity ejb, CORBA object, rmi object..?
 
Brett Spell
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!