• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI and multithreading

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have a basic doubt in RMI. How does RMI take care of multiple clients accessing the same method. Does it span a new thread for every client. If so, then do I need to make the method synchronized if I want it to be accessed in a thread-safe manner.
Thanks in anticipation,
Smita.
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Smita,
Excerpts from the RMI Specification -
" A method dispatched by the RMI runtime to a remote object implementation may or may not execute in a separate thread. The RMI runtime makes no guarantees with respect to mapping remote object invocations to threads. Since remote method invocation on the same remote object may execute concurrently, a remote object implementation needs to make sure its implementation is thread-safe."
Regards,
Milind

[This message has been edited by Milind Kulkarni (edited July 17, 2000).]
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
In the stateless bean i have business methods and utility methods.Please advice if these utility methods need to syncronized if they are being called by multiple business methods in the same bean and the business methods in turn being called by multiple clients at the same time.

Following is piece of code from my ejb :
public interface MySessionEJB extends EJBObject {
public String businessmethod1(String id,String abc)
throws RemoteException, Exception;
public String businessmethod2( String password, Stringdept)
throws RemoteException, Exception;

Thanks,
smita
 
You showed up just in time for the waffles! And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic