Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session in stateful session bean

 
Rudy Harianto
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From HFEJB page 559, the 3rd Client Scenario, state that:


"Client Foo calls a method on a remote stateful bean, while that same bean is already executing a method for client Bar"
The answer is:
"Client Foo gets a RemoteException (if client Foo had been local, he'd get an EJBException). A session bean handles only one client at a time!"


i wonder under what cases do this scenario will happen?
In my understanding, stateful session bean only serve one client, the client who does the creation of this bean. So how can there be another client?

Best thing I can imagine right now is that the EJBObject is passed to other client as a return value or argument. So there are 2 clients who can invoke methods on the same EJBObject. But if this is what happened, how does the container managed the session? One session id to handle 2 clients? Isn�t that awkward?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic