JBoss Community

Re: How does a @EJB dependency injection work on a Stateless Bean? Will that injected class behave like an instance variable in that stateless session bean?

created by Viggo Navarsete in EJB3 - View the full discussion

Yes, you're correct! Whenever a new instance of PrimaryStatelessBean is created by the EJB container (and since it's a stateless annotated bean, you will get a new one for each request), then you will get injected a new instance of SecondaryStatelessBean (since it's most likely also a stateless annotated bean, based on your naming convention), and you will get access to the *one instance* of SimpleSingletonBean that has been created by the EJB container (since it's a Singleton annotated bean).

Reply to this message by going to Community

Start a new discussion in EJB3 at Community