geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio ForniƩ <sitaronoctur...@gmail.com>
Subject Re: Stateful session bean has no state
Date Mon, 12 Oct 2009 22:38:56 GMT

Thank you once again. Now it has state, the problem now is that it has the
same state for everybody. I used two browsers at a time, a Firefox and an
IE. They both had the same state, if I refreshed one of them then the number
had been incremented for the other one. By the way, I used @EJB annotations
to have my SFSB injected in my servlet (in case it helps).

Just in case you were about to reply that I have to look for my SFSB in my
session and if there's no SFSB there I have to look up via JNDI, right?
Well, however, it seems I will have to do all the work to keep an object
(the SFSB) per session, so... what's the use of Stateful Session Beans? If I
will have to do all the work by myself, I can create an object (not a EJB,
but a simple POJO) and avoid using complicated EJBs. I mean, I though
container was responsible of assigning a SFSB to each session.

Of course, if the only advantage was to have an object (the implementation)
knowing only the interface, I can use a Factory Method Pattern or many other
solutions.

Please, don't see me as an EJB detractor, I'm only asking because I really
liked the fact that using Stateful Session Beans I could forget about
managing objects in session as the container was doing that work for me. I
only want to know.
-- 
View this message in context: http://www.nabble.com/Stateful-session-bean-has-no-state-tp25861132s134p25864259.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message