Dan, According to the EJB spec, it is the containers responsibility to synchronize the calls to a stateful session bean. The client does not have to enforce the sychronization. I have stored the handle to the session bean in the HttpSession for the servlet and use the handle the get back to the session bean. I have not dealt with the Pet Store Demo, so I can't comment on that. Mark >I am confused about how to use EJB session beans from servlets. Isn't >is true that EJB session beans should only be accessed by one thread at >a time and that the client must enforce that? If that is the case then >doesn't that mean that an EJB session bean should not be saved in a >session object, since session objects can be accessed by more then one >thread at a time. (I am referring to session objects in the servlet >sense now, not the ejb sense.) This happens when multiple windows are >open or when frames are used. > >For example, it looks to me like the ejb session beans are saved in >various session object of the Pet Store demo. Doesn't this mean the >demo is not thread safe? > > >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". > =========================================================================== 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".
