0 Replies Latest reply on Apr 13, 2006 12:05 AM by redpoint7

    Newbie Question: Stateless Session Bean + Injection

    redpoint7


      I have a basic understandind question about stateless session beans and injection:
      A statless session bean doesn't hold any state, but what happens if you inject some beans that are user realted (request or session scope)? that would mean the stateless session bean has a state (for the request).

      For example:

      @Stateless
      @Name("register")
      @Interceptors(SeamInterceptor.class)
      public class RegisterAction implements Register
      {
      
       @In
       private User user;
       @In
       private FormBeanXY formBean;
      
       public String processRegister()
       {
       .... do something with the injected beans and call other methods of this bean or other injected sessionbeans ...
      
      


      if multiple useres access this sessionbean at the same time, will this cause troubles? Or does every user get a new instance of the stateless session bean (with the specific injected values)?

      By the way: In the documentation I found an example of a stateles session bean with the scope EVENT : Does this make any sense? Will this bean be destroyed after the request, or does it mean, it is just referenced under der Event context too?