Here's how I see it.
You don't necessarily need stateful session beans ( or entity beans )to manage session state. You can do it via the servlet session management.
Session management using stateful session beans is useful in certain scenarios where you have clusturing of web servers some of which are not running servlets OR you have a lot of session data which you don't want to be stored as servlet session data.There are some other adavantages too..
Keep in mind though that using stateful session beans and stateless sessions bens is a not an exclusive choice. You would use stateless session beans to wrapper your business logic methods on entity beans.
You can use stateful session beans along with stateless session beans if you want them to manage your session data.
> -----Original Message-----
> From: Parikshit Pol [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 22, 1999 8:58 PM
> To: [EMAIL PROTECTED]
> Subject: Re: State and Session Management
>
>
> ______________________________________________________________
> _______________________________________________
> Parikshit Pol
>
> >
> > Dear All,
> > I'm Writing an Application in which a Servlet is used to
> Access a Stateful Session Bean , which in turn accesses
> multiple Entity beans.The Stateful Session Bean manages the
> workflow and maintains the Client State .
> >
> > Here in this Application we are supposed to add items to a
> shopping cart .
> >
> > But as a Servlet State is not maintained across across
> multiple requests from a Client , what is the use of
> Stateful Session Bean?
> > I can maintain the Client Session state in a Servlet by a
> Cookie , and the shopping Cart contents in a temporary
> Database on the Server associated with the Client Session state.
> >
> > But then the Stateful Session Bean has no use here .
> Because each time the Servlet has to create a new instance of
> the session bean, as each time a new Instance of the Servlet
> will be invoked for each request from the Client.So am I
> Better off using stateless Session Bean instead of Stateful
> Session Bean.Or is there any other alternative to this
> solution or am I wrong somewhere.
> >
> > Thanks for Reading,
> > Parikshit
>
> Hi Shelly,
>
> You can store the remote reference to the stateful session bean in the
> HttpSession and then look it up everytime. Then you wont be recreating
> it everytime.
>
> regards,
> inder
>
>
> [Parikshit Pol]
> Hi InderJeet,
> Thank you , but could you please elaborate on that.
> Parikshit
>
>
> >
> >
> ==============================================================
> =============
> > 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".
>
> ==============================================================
> =============
> 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".
>
> ==============================================================
> ============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".
>
