Just something I recall, statless session beans are handled much like
database connections by the ejb container. The ejb container generally pools
x number of instances of a session bean. Each request that comes in gets
assigned a bean instance for the duration of the request. It then gets put
back in the pool for another request to use. If more requests come in than
there are instances, more instances are created. If a period of time goes by
when x number of instances aren't being used any longer, the ejb container
will discard them, thereby releasing the resources used by those instances.
Statefull beans are not stored in a pool, but instead last the life-cycle of
a session, not a request. This is very similar in nature to the HttpSession
and HttpServletRequest. HttpSession lasts as long as a session is active or
until a time-out occurs (based on a time set in web.xml). All objects in
HttpSession stay in existence until the session has been invalidated or
expires (or they are removed). HttpServletRequest has a life-cycle as long
as a request exists..until the response goes back. Any objects in the
request are released when the response goes back. Much like a "global"
variable and a local (method) variable. Global variables last for a period
of time, local method variables are created and released during the duration
of the method call.


> -----Original Message-----
> From: Venu Gopal [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 19, 2000 4:05 PM
> To: [EMAIL PROTECTED]
> Subject: Re: stateless and statful bean
>
>
> In Short ..
>
> Stateful bean is the one which uses save() and then
> load() methods???
>
> Stateless is the one which doesn't use the both
> methods??
>
> Please clarify..
>
> Cheers,
>
> Venu
>
> --- Vyom Agrawal <[EMAIL PROTECTED]>
> wrote:
> > Hi there,
> > Well the difference lies in the application of the
> > bean and its life cycle.
> > If the bean has to be deployed only once and
> > destroyed then its a stateless
> > bean but if the same bean is deployed and used again
> > and again then it is
> > known as a stateful bean..
> >
> > Hope that helps
> >
> > ---------------------------------------------------
> > Vyom Agrawal
> > Bhilwara Infotech Limited,
> > Bhilwara Towers,
> > A-12, Sector-1
> > NOIDA - 201301
> > NCR - Delhi (INDIA)
> > Ph.     +91-120-4440293  (Direct)
> >            +91-120-4541810 Extn: 484
> > Fax     +91-120-4440294
> > Mobile +91-9810329625
> > mailto: [EMAIL PROTECTED]
> >              [EMAIL PROTECTED]
> >
> --------------------------------------------------------------
> --------------
> > -------------
> >
> >
> > -----Original Message-----
> > From: A mailing list about Java Server Pages
> > specification and reference
> > [mailto:[EMAIL PROTECTED]]On Behalf Of
> > zhangkai
> > Sent: Tuesday, December 05, 2000 8:39 PM
> > To: [EMAIL PROTECTED]
> > Subject: stateless and statful bean
> >
> >
> > hi guys
> >
> >  i am confused !
> >  whats the difference between stateless session bean
> >  and state bean?
> >
> >  whats the features of statless session bean?
> >
> >
> >  thanks in advance
> >
> >
> ==============================================================
> =============
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> > body: "signoff
> > JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body:
> > "set JSP-INTEREST
> > DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
> >
> ==============================================================
> =============
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> > body: "signoff JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body:
> > "set JSP-INTEREST DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Shopping - Thousands of Stores. Millions of Products.
> http://shopping.yahoo.com/
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to