I think you should be better off reading a book on EJB.
Changing the deployment descriptor for a bean from stateless to
statefull does noet really make much sence. It´s a design question!
A ShoppingCartBean is a typical example for a Statefull session bean
(you would want the shopping cart to hold the items you buy now wouldn´t
you) the BuyEverytingThatsInYourShoppingCartBean is a typical example of
a Sateless session bean. When at K-Mart you use the cashier once and you
surely would not want it to maintain state for you (Keep your creditcard
number etc). It does nat make any sence to change the SoppingCartBean to
stateless (unless ofcource you are going to maintain state at the web
application) and it does even make less sence to make
BuyEverytingThatsInYourShoppingCartBean statefull since all it does is
something like BuyEverytingThatsInYourShoppingCartBean.buy(Cart c)
There is no real definition for the underground process, it has
different implementations for each app server. The specs don´t say
anything on how this process works, all it says s that Statefull beans
maintain information on behalf of the clients and stateless don´t. In
general Stateless session beans are maintained in a pool and the app
server picks one from the pool whenever it´s needed. Statefull session
beans cannot be pooled, they´re passivated whenever the app server
thinks it´s necessary (their fields should be serialized and stored).
Cookies and Machine IP have nothing to do with App Servers, that´s web
server. An HTTP Session is something completely different (http is a
stateless protocol)
Sven
Hariharan N wrote:
> Could anyone (with a sample application) demonstrate the exact difference
> between Statefull and Stateless bean. Say for example in the sample
> application(may be with one function) when
> <session-type>Stateful</session-type> tag in the ejb-jar.xml is changed to
> <session-type>Stateless</session-type> should show the persistence which
> happens with statefull and not with stateless!!!
> Also explain clearly with respect to the sample app. the underground
> process. Like when this sample app is invoked as a statefull then it should
> maintain state etc..
>
> Also how does app server maintain client state??? thro' cookies or machine
> IP etc...
> Thanks!!
>
> ===========================================================================
> 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".