aspose file tools*
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 Java 8 in Action this week in the Java 8 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
 
Similar Threads
Session in stateful session bean
Session beans equal method.
getEJBObject() in ejbCreate() for SLSB
Mock exam question (states)
System Exception Confusion