Hi,
  Adding to the discussion, I think there are many business scenarios, where
a singleton stateful instance is needed for the business processing which
may be accessed concurrently. In that case, how can I use EJBS to implement
that?


Karthik



-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Kenneth D. Litwak
Sent: Wednesday, July 17, 2002 4:53 PM
To: [EMAIL PROTECTED]
Subject: Re: Handles and threads


>I think you are confusing bean instance with remote stub instance.  The
spec
prohibits a container from accessing a bean instance from two threads.
However,
it is not as clear on client-side concurrent access to EJBObjects, and this
behavior may be different across vendors.  Note the spec is clear on
concurrent
access of StatefulSessionBean EJBObjects, which is prohibited and will throw
ConcurrentModificationException or ReentranceException.

  Gene, this is exactly my point.  The spec says that multiple threads
accessing
a staeful session bean (because they are multiple callers, each on its own
thread) is illegal for a stateful session bean. Therefore, what would be the
piont of getting a handle to a staeful session bean? Since you don't get to
hae
any one specific stateless session bean across calls, that's obviously
useless,
even if a container allowed multi-thread access to a stateless session bean.
Given what you've said about stateful session beans, which was my point.
what
good would a handle do you?  Since the first caller already has an object
reference to the bean, getting a handle as well would be redundant. SInce no
other caller can use the same stateful session bean, passing any other
caller
the handle would only invite an exception.


  Ken

 When it comes to SLSBs, though, you're at the mercy of your container.
>Gene
>  "Kenneth D. Litwak" <[EMAIL PROTECTED]> wrote: According to the
spec, it
is illegal for two client threads to access the
>same session bean instance. So let/'s say I get a handle to my bean
instance
>(not a home handle). I cannot give this handle to another client because it
is
>illegal for two clients to access the same session bean instance. I already
>have a reference to the bean's EJBObject before I get a handle. So hat good
is
>the handle? Thanks.
>
>
>Ken
>
>===========================================================================
>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".
>
>
>
>---------------------------------
>Do You Yahoo!?
>Yahoo! Autos - Get free new car price quotes

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