Hi

The article mentioned below, "Writing Enterprise Applications with JavaTM 2
Platform, Enterprise Edition", discusses how ejb's can be used with
servlets.

In the example, the "BonusServlet" has an instance variable "theCalculation"
which is a session bean.
According to the EJB spec, session beans (stateless or stateful) do not
support concurrency.  Only one thread can access a session bean at a time.

Servlets, on the other hand, (when not implementing the SingleThreadModel)
are multi-threaded.  More than one thread can access a servlet at a time.

If a session bean is created as an instance variable of a servlet, and it's
used in the doPost or doGet, that means more than one thread will be
attempting to invoke methods on that bean.  And when that happens, an
Exception will result.

Albert

-----Original Message-----
From: Bo Xu [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 07, 2000 12:24 PM
To: [EMAIL PROTECTED]
Subject: Re: Servlets & Session Bean


Hi,

There are 7 lessons in :
http://developer.java.sun.com/developer/onlineTraining/J2EE/Intro/

and in Lesson 1, you can find it.


Bo
May 08,2000





Naresh wrote:

> hello
>
> Can anyone tell how a servlet can communicate with a session bean..?
>
> thanks
> naresh
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to