I understand that since the bean is stateless the beans instance may not be
the same for two invocations on the same objref. But I am wondering whether
the EJBObject will be diffrent as well. I read that the bean instance may
get swapped for the same EJBObject instance.
And also I am planning to take the objref in the client side and let
multiple threads use it. I am pretty sure that this thing will bomb in case
of stateful sssion bean -- but whether the same will happen for stateless is
the question.
cheers
Ana

-----Original Message-----
From: Subrahmanyam Allamaraju [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 06, 2000 10:40 AM
To: [EMAIL PROTECTED]
Subject: Re: session beans|EJBObject and thread


Hi Anamitra,

> I have a confusion over the ralationship between a client thread, an
> EJBObject and the actual beanImpl instance.
> Lets take the stateless session bean first.
> In the client side I get an objRef for the bean like this:-  Register
> register = registerhome.create();
> Now when I invoke a method on the "register" object, the invocation first
> goes to an EJBObject which
>  in turn fwds the request to an instance of the stateless session bean.
> Q1> Now if I again invoke the another method of the objRef then does the
> invocation goes to the same EJBObject instance everytime??
> OR it goes to a diffrent EJBObject instance??
> The spec says that a client cant assume that the same bean instance will
> service it every time. But can the same EJBObject instace
> service it everytime if the objref used is the same??

Need not, because the bean above is stateless.

> Q2>Now can that "register" objRef be used in multple threads??

The objRef (the register object) is a remote stub. I'm not sure if it has
been stated in the spec, but the objRef need not be thread-safe.

In effect, the association between the objRef and and instance is dynamic,
and is managed by the container.

- Subbu

===========================================================================
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".


STATEMENT OF CONFIDENTIALITY.   The information contained in this electronic
message and any attachments to this message are intended for the exclusive
use of the addressee(s) and may contain confidential or privileged
information. If you are not the intended recipient, please notify
USPowerSolutions Corporation immediately at (617) 547-3800, or at
[EMAIL PROTECTED], and destroy all copies of this message and any
attachments.

===========================================================================
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