This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Exception - HF EJB page 559 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Exception - HF EJB page 559" Watch "Exception - HF EJB page 559" New topic
Author

Exception - HF EJB page 559

Sandesh Tathare
Ranch Hand

Joined: Jun 22, 2003
Posts: 82
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?


Regards,<br />Sandesh<br />(SCJCP, SCWCD, SCBCD - 99%, OCP-1)<br /> <br />Either find a way or create one.
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
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

Joined: Jun 22, 2003
Posts: 82
Thanks Kathy for a detailed explaination. I got it clearly now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception - HF EJB page 559