• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Doubt on Stateful session bean

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have a doubt with ejb 2.0 spec, it has been given in Pg. 76 and section 7.5.6 that "If a client-invoked business
method is in progress on an instance when another client-invoked call, from the same or different client,
arrives at the same instance of a stateful session bean class, the container may throw the
java.rmi.RemoteException to the second client[4], if the client is a remote client, or the
javax.ejb.EJBException, if the client is a local client
." I assume a conversational state can be maintained between a client and a single stateful session bean. If thats the case how cum another client invoked call come into play bfr even the first is still alive. Please clarify my doubt.

Thanks.

Regds,
Raj
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is possible that another(second) client can able to call bean method by having it's remote object's stub.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't have a complete answer. But part of it makes sense. Instead of a web application think of a java swing application as the client for the ejb. You could look up a stateful session bean reference and then have some multithreaded functionality where each thread invokes some method on the bean. This would mean concurrently calling two methods on the same bean instance and according to the spec will end up in an exception. However this only explains two calls coming from the same client. From your quote of the spec '..from the same or different client..', looks like it is implying that two different clients can invoke methods at the same time on the same bean instance. I do not think this is possible.
Ramakrishnan, could you claify how the second client would get access to the bean? Were you thinking of the first client passing it's reference to the second client? In that case, from the ejb's view wouldn't the two clients appear as just one client, since the second client would simply be using the first clients identify?
[ September 05, 2006: Message edited by: Arun Natrajan ]
 
expectation is the root of all heartache - shakespeare. tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic