They *could* become a shared resource, however, if the client runs multiple
threads against the same session bean reference, which is quite common in
servlet applications....

The EJB Spec guarantees that only one method call at a time will be allowed
on any Bean, IIRC, so other callers will be blocked on any bean method until
the first method completes and returns.

Ted Neward
{.NET || Java} Course Author & Instructor, DevelopMentor
(http://www.develop.com)
http://www.javageeks.com/tneward

----- Original Message -----
From: "Chetan Hiremath P" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 09, 2002 8:24 PM
Subject: Re: [EJB-INT] EJB reference in Java Pet Store(thread safe???)


> I think we need not make it thread safe coz the session facade what u
> mentioned is not a shared resource. Session beans are private, they r the
> extension of the user(each user has a seperate session bean) in the ejb
> container (unlike any other resource like a FileInputStream, Socket
> connection etc).
>
> -regards
> Chetan P Hiremath
>
>
> > -----Original Message-----
> > From: Sunder Rajan [SMTP:[EMAIL PROTECTED]]
> > Sent: Thursday, January 10, 2002 7:05 AM
> > To:   [EMAIL PROTECTED]
> > Subject:      EJB reference in Java Pet Store(thread safe???)
> >
> > Iam trying to obtain a reference to my session facade  bean from my
> > servlet, After looking at the archives, I have realised the safest way
> > to obtain one is from the init method of the servlet. But, in the java
> > pet store code
> > (petstore1.3/src/waf/src/controller/com/sun/j2ee/blueprints/waf/controll
> > er/web/WebClientControllerImpl.java), they obtain a reference to the
> > home interface in a non synchronized method. Is this thread safe ?
> >
> > Sunder
> >
> >
==========================================================================
> > =
> > 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".

Reply via email to