EJB 3.0 - Stateful... getHandle()?
Hello,
I just start working with EJB 3.0 and it's much better if we compare with EJB 2.x... It's easier, cleaner, etc. However I'm about to throw all away and return the EJB 2.x
I simply cannot efficiently call getHandle() on a stateful session bean. Well, actually withing the bean itself I can do cxt.getEJBObject().getHandle() but that's weird. I want a handle in the client side and I can't. Here's the situation
I'm developing an app that will have a number of different clients. Web and desktop. In my project it's defined that the user session will be in the EJB tier and will be a Stateful Session Bean. So far so good.
The thing is, for the web client, I want to store each user's session in the HttpSession. With EJB 2.x I would get the ejb handle and would serialize it in the httpsession, then when the user get's back in a few minutes we can restore the EJB from the handle. Another weird thing is the way we're forced to declare:
publicclass ServletTestextends HttpServlet{
@EJB
private UserSessionRemote session;
With the above declaration I understand that for every single time someone access ServletTest all web users will get the very same stateful. Well I made that test :-/
We have no control of stateful session bean in EJB 3.
How to control that from the web side? In a swing/swt client I can keep the reference...
Thanks in advance
Aurelio

