geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio ForniƩ <>
Subject Re: Stateful session bean has no state
Date Tue, 13 Oct 2009 15:40:54 GMT

Yes, each Servlet it's created only once. I think that's true for ALL Servlet
Containers, in fact is part of the specs, that's why so much has been
written about about thread safe Servlets, against and in favor (do you
remember there was a time when everybody tried to use thread safe servlets,
and some years later everybody forgot about it just to remove critical code
from the servlets in order not to lose performance?).

I though that it could be like you say, having to manage myself the
one-EFSB-per-session matters, but I didn't want to believe. I knew that
using EJB had those benefits (transactional, distributed...) and that EJB
prior to version 3.0 was rather complex (I've read the famous Rod Johnson
book about development without EJB) and that's why I've been working with
Spring for years... Now that I was trying to get involved in EJB 3 I find
that EJB 3.0 is much better, but in the case of Stateful Beans it's been a
surprise: I don't understand why to use the @EJB annotation for a SFSB. It's
only valid for the first user session, right?

I though that being EJB 3 a response to Spring, managing objects per session
would be a little easier.

Anyway I will use your recommendation and have a class to make sure I always
have one and only one SFSB per session. I didn't know about @LocalClient

Thank you very much for your detailed answer. By the way, and only to learn,
what would you answer to people who think EJB 3 is still far more complex
than other alternatives.

Thank you very much!

View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message