In the EJB spec there are two options.  Lets assume a single EJBObject
representing a row, say a row with a primary key of "100".

The clients do a findByPrimaryKey("100");

There is only one EJB object, however there can be one, or many actual bean
instances.  Containers vendor can choose between a single bean instance to
represent the EJBObject, and then the container must synchronize access to
the single instance.  The second option lets the container use multiple
instances of the bean to represent the single EJBObject.  When this option
is chosen, the RDBMS is used to syncrhonize the access.  Containers in this
case must also manage local diamond formations.

There is no need for you the developer to syncrhonize access.

Dave Wolf
Internet Applications Division
Sybase



----- Original Message -----
From: "Nitin Kumar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 03, 2000 8:32 PM
Subject: Re: One EJBHome Instance???


> Jonathan:
>
> Thanks for the reply. But I think I need to further explain my Query. I am
not
> talking about the EJB Implementatation Object, I know each client gets its
own
> instance from the Pool. I am talking about the EJBHome implementation
> instance. Since we search with the same name in the JNDI for the EJBHome,
does
> that mean that all clients are talking to the same EJBHome Object
> Implementation instance?? If that is true, how is it handled by the
> implementation if say 20 client try to invoke a same Finder or Create
method
> on this single Remote Object implementation? Will this be thread safe
(Does it
> really need to be thread safe?), will it have any performance
bottlenecks?? I
> am not clear? please provide your comments.
>
> Thanks
>
> Nitin
>
>
> Nitin:
>
> The container doesn't use the same bean for all requests.  The Home
> interface is coupled with a bean from the pool (or one is created from
> scratch) for each user.  So, if you have multiple people talking to the
same
> home interface, they will each get an instance of the bean to act as a
> factory.
>
> So, you don't have to make the bean thread safe.  :-)
>
>
> Jonathan Baker
> Internet Applications Division
> Sybase
>
>
>
> Nitin Kumar wrote:
> >
> > Hi All
> >
> > A quick question, when we lookup the Home Object from the Client code
for a
> > particular bean, if we use the same "HomeName" in the lookup, all the
>  clients
> > would bind to the Same Remote Object Instance. Since one unique name in
the
> > JNDI can refer to one object, I am assuming my understanding is true.
> >
> > If my understanding is write, then this means that all clients invoke
>  methods
> > on the same instance, is this thread safe, and what about performance,
is
>  this
> > an issue? Any inputs on this would be great.
> >
> > Nitin
> >
> > ____________________________________________________________________
> > Get free email and a permanent address at http://www.netaddress.com/?N=1
> >
> >
===========================================================================
> > 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".
>
> ____________________________________________________________________
> Get free email and a permanent address at http://www.netaddress.com/?N=1
>
>
===========================================================================
> 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