Jose Gonzalez wrote:

 
    The EJB specification states that a single instance of an EJB cannot
receive concurrent calls, and that the container must serialize calls,
but I understand that this is the desired behaviour in case of a program
invoking methods on an stateful session bean, not in the case of
invoking methods on stateless session beans...

    Am I right? Is NetDynamics doing right according to the EJB specs?
If yes... how could I achieve concurrency on calls on an stateless
session bean?

Actually the container is not responsible for serializaing calls to a stateful session bean in the way you think.  For example suppose threadA and threadB are running concurrently and each thread makes the following invocation.

myStatelessSesssion.foo();

So each thread is making a call on the same method and the same entity object.  In that case the container should (according to the spec) throw a RemoteException.

So you may be wondering what is the meaning of the phrase,
"A container must serialize calls to the session bean".  The spec is talking about calls that the container makes to the session bean instance not calls made to the session object.  Note that the container will make calls like ejbLoad, ejbActivate, and ejbPassivate in addition to calls to the business methods.

To answer your question, which actually applies to both stateful and stateless session beans, EJB does not provide a way to serialize calls.  To me this is a major weakness of EJB.

dan
 
 

 

    Greetings
    Jose

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