James Cook wrote:
> Are you generalizing, or are you talking about a specific EJB container?
> From what you are stating, I could never have a servlet talk to stateful
> session beans, because every thread of execution in my servlet would be
> talking to the same bean.
>
> jim
That is true because clients are not allowed to make concurrent calls on session
beans (stateful or stateless). The container is expected to throw an exception
in that case.
But if you store a reference to the session bean in an HttpSession object you
may incorrectly believe that concurrent calls will not occur. However that is
also not true because HttpSession objects might be used by more than one thread
in a couple of cases.
1. Multiple windows open in a browser.
2. Multiple frames in a browser.
The one solution I have heard that will work is to create a wrapper class around
the session bean whose methods are synchronized. For each method in the remote
interface of the bean there will be one synchronized method in the wrapper class
that will call the remote interface method.
dan
===========================================================================
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".