Hi,

Consider this example.
Statefull session bean has two fn.
doSum(int,int)
int getSum();
and instance variable sum=0;

Now suppose on the first page(jsp)you call this fn doSum(5,6); this will sum
the two nos and put the total in sum=11. Now suppose you visit second page
retrieve the handle to session bean (saved in first page) and call the
getSum() fn then you will get the return value as 11. This state(in the form
of variable sum is not shared by any other client and will continually have
this value unless the remote is gone from the session or the bean is
destroyed.

Statefull session beans maintain such type of state for the clients. Has it
bean that it was stateless bean then this was not gauranteed that when you
call the getSum() fn. it will return 11.

Hope this clears your doubts.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Warm Regards
Ashwani Kalra
Sr. Member Dev. Staff
Aithent Technologies(P) Ltd.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of SUBSCRIBE EJB-INTEREST
Karun
Sent: Friday, June 08, 2001 2:12 AM
To: [EMAIL PROTECTED]
Subject: Storing Stateful Session Bean in HttpSession


Hi

Do we have to store Handle to the Stateful Session Bean in HttpSession as
suggested by PetStore application? If we have to, then what is the use of
Stateful Session bean? I am assuming that many of you might have discussed
this already...

Am I missing anything here?

I appreciate your comments/suggestions.

Thanks
Karun

===========================================================================
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".

Reply via email to