I was just reading an older thread in which someone pointed out that
"Stateful Session Beans reduce scalability". Then multiple responders
concurred with his point. Then the idea of using using Stateless session
beans to achieve better scalability came up.

But this logic doesn't make sense to me. If you need to maintain state (as a
shopping cart does) use need to maintaining state. So the question "Use
stateful or stateless session beans?" isn't the write question to ask. The
question should be, "WHERE to maintain state?". As I see it, there are 4
possibilities (assuming web based app):

1. Use HttpSession (which passes sessionid as cookie or encodes it into the
URL)
2. Don't use HttpSession (still use cookie) and simply pass the cookie on to
a stateful session bean, which manages the state.
3. Don't use HttpSession or Stateful Session Bean, but rather, pass cookie
all the way to the database and have the database hold all the state.
4. I guess you could pass ALL the state back and forth to client everytime
as a giant cookie, the no server has to store the state. But this desn't
seem smart.

So I guess the question is, in which tier should state be stored? Servlet
Engine tier, ejb tier or database tier.

If the answer is "servlet engine tier" or "database tier", then this seems
to greatly diminish the need for ejb in the first place.

I guess the answer to the question depends on the goals. If the goal is
"ease of app development", then get rid of ejb altogether (as ejb is an
extra level of effort and complexity) unless you really need distributed
transactions. But then I thought jdbc 2.0 can provide distributed
transactions, right?

But my main question is, if SCALABILITY is main goal, where is the best
place to store state?

Dave Ford
Smart Soft - The Java Training Company
http://www.SmartSoftTraining.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to