Juan Hern�ndez G�mez wrote: > I'm also interested why an EJB container makes a pool for stateless session > beans and don't creates only one instance and let multiple threads execute > in, it's similar to servlet execution, isn't it?
Similar, yes, except stateless session beans ensure that there is thread-safe access to instances in order to be 100% concurrency safe, with regard to non-conversational state. Note that this is what you get with the SingleThreadModel interface in servlets. > Because it can have state that is not conversational. What's conversational > state? Could you explain more? Thanks Conversational state are those object variables that change as a side-effect of client calls. For example, the instance could have a call counter, which would be increased for each call. That would represent conversational state and if you used that in a stateless session bean you would get compeletely random results since the client does not know which physical instance it is working with. The inclusion of such conversational state hints that it should probably be changed to a Stateful Session Bean. /Rickard -- Rickard �berg Author of "Mastering RMI" Chief Architect, TheServerSide.com The Middleware Company - We Build Experts! =========================================================================== 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".
