Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Exception - HF EJB page 559

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Pls refer to scenario listed on HF EJB page 559 as mentioned below:

Scenario:
Client Foo calls a method on a remote Stateful bean, while that same bean is already executing a methof for client Bar.

Answer:
Client Foo gets a RemoteException. A Session bean can handle only one client at a time.

But a stateful session bean is tied up with a particular client, isn't it? So how come a stateful bean tied up with client Foo is serving client Bar?

Can some one please explain?
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good question

A client could pass a component interface reference to another thread, for example, and as far as the Container is concerned, that's two separate clients. Or more likely, a Handle could be given to more than one client, and both clients could use that Handle to get a reference to the component interface, and then... you have the problem.

So, it's not very likely that this will happen, but it COULD happen, and the Container raises an exception.

cheers,
Kathy
 
Sandesh Tathare
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kathy for a detailed explaination. I got it clearly now.
 
Have you no shame? Have you no decency? Have you no tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic