> I have my own doubt
> what happens if multiple threads starts accessing the same stateless
> session
> bean object at the same time ?
The 1.0 EJB spec didn't recommend doing this, and as per the 1.1 spec, this
will throw an exception now.
Can anyone enlighten me why multithreaded access to session beans is not
allowed or recommended. Can't the container enforce serialization? We
have a pattern in place where all the service components are sitting behind
a single session bean facade, but since our client is multithreaded, this
won't work. We're now looking into session pooling on the client, but
I'd like to know what the reasoning is behind this restriction. Why can
entity beans be flagged as reentrant, but not session beans?
Thanks,
Frank Sauer
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of G Srinivas
Sent: Sunday, October 31, 1999 9:26 AM
To: [EMAIL PROTECTED]
Subject: Re: Two EJB-related questions
Hello,
kdlitwak wrote:
> I have two questions:
>
> 1. I want to have a shared object in an EJB container. That is, one
> object, one object reference shared by and used by multiple callers at
> once. Can this be done? Can multiple clients share a stateless session
> bean since it has no data values to corrupt?
>
> 2. If I call an EJB method from something besides a servlet or JSP,
> does hat make my application non-J2EE compliant? Thanks.
>
> Ken
>
For 1 :
As per the EJB Specs 1.1 ( refer sequence dia ) regarding the stateless
session
bean, we feel that by calling remove() the container calls the ejbRemove()
immediately on its instance but the container calls only if no other client
using the same object. Hence the stateless session beans are shared across
the
clients ( pl correct me if I am wrong !! ), but here we are trying out few
protos to check whether these beans are synchronized. I have my own doubt
what happens if multiple threads starts accessing the same stateless session
bean object at the same time ?
For 2 :
The J2EE docs doesn't say it has to be Servlet , JSP or Web server. I dont
think it makes J2EE compliant.
Thank you
G Srinivas
Software Engineer
==========================================
L&T Information Technology Ltd.
Safire Park Galleria,
Next to Shivaji Nagar Rly Station,
1st Floor ,
Mumbai Pune Road,
Shivajinagar,
Pune - 411 005 (India).
Phone : 91-20-5812162/4262/5462//6079/4012
Fax : 91-20-5815742
EMail : [EMAIL PROTECTED]
Web : www.ltitl.com
==========================================
===========================================================================
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".