File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Exception - HF EJB page 559" Watch "Exception - HF EJB page 559" New topic

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:

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

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

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

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:
subject: Exception - HF EJB page 559
It's not a secret anymore!