-
1. Re: Stateful Session Bean dilema
joelvogt Aug 12, 2002 3:24 AM (in response to jlbakker)well sort of, what are you actually doing with the stateful beans? Are you doing updates or deletes etc?
-
2. Re: Stateful Session Bean dilema
jlbakker Aug 12, 2002 8:20 AM (in response to jlbakker)As far as I can see the methods I invoke are read-only operations.
Thanks,
John-Luc -
3. Re: Stateful Session Bean dilema
jlbakker Aug 13, 2002 11:54 PM (in response to jlbakker)Hi Joel and others,
I really like to understand why I cannot have one thread per SFSB simultaneously. Is it a JBOSS or EJB limitation? Is it specified in the EJB spec.? Any pointers appreciated!
Best regards,
John-Luc -
4. Re: Stateful Session Bean dilema
sgturner Aug 14, 2002 1:11 PM (in response to jlbakker)You said that the SFSBs are stored in a Map. Maps are not thread safe and I am assuming that all requests have access to this Map. That may be the source of your problem. Why not store the SFSB in the HttpSession object? SFSB are not meant to be used asynchronously.
-
5. Re: Stateful Session Bean dilema
jlbakker Aug 14, 2002 8:59 PM (in response to jlbakker)Thanks. Meanwhile I have changed the code such that the bean is now stateless; the state is stored in the URL accessing the servlet. A stateless bean is the preferred solution anyway. I will have a look at HttpSession objects and see how they may make things easier!
Your suggestion that the error may be caused by the Map may also be true; as I once noticed exceptions in odd places with a not so stateless stateless session bean. Thus, there is no architectural or JBoss reason why each SFSB could not be accessed by its own thread, simultaneously. I agree that in my case (and perhaps in most cases) SFSBs should be avoided.
Thanks again!
John-Luc