Suppose we have 2 EJB's (stateless for example) A and B.
@Stateless
public class A {
@EJB
protected B binstance;
}
So after we used our A bean in servlet, it should be returned back to pool, and the question is does EJB container "dereference" B instance from A, i.e. at the next invocation we could get another B object inside the same A instance? Is the same still valid for JAX-RS, when we make a bean REST service and inject some other beans there? Does JAX-RS bean created like servlet or like an ordinary EJB instance in this sense (I mean servlets still hold references to beans instances)?