PREMISE:
stateless EJB_X contains annotated reference to EJB_Y (e.g., "@EJB EJB_Y")
EJB_X needs to initialize EJB_Y before calling its business methods
Suppose that EJB_X both (a) initializes and then subsequently (b) calls EJB_Y's business method(s) - i.e., a "multi-step" process(?)
QUESTION:
Does EJB_Y need to be annotated as "@Stateful" in order to be thread safe?
NOTE:
Would otherwise have EJB_Y be just a simple POJO (e.g., POJO_Y) - however, it seems that, in order to have an logging "@Interceptor" class access method parameters used EJB_X's call to EJB_Y's business methods, EJB_Y must be an EJB (?)...
Other info:
a. EJB 3.1
b. EJB_X exposes REST methods
c. currently relegated to WebLogic 12.1.3 running JDK 1.8.x
A question:
And few points:
[UPDATE]
It does not make sense to invoke a SFSB from a SLSB. In the end you will have unpredictable results, just because of the nature of SLSB of living in a pool and being shared among clients. You will also loose one of the most important benefit of a SLSB: scalability.
I don't know much about your architecture and design, but I would revisit the web service layer by getting rid of the front end EJB and structuring instead a class to behave as a web service (by use of annotation). Then, if you want to stay in the EJB world, pass all your data within the EJB invocation context, and then retrieve it from the EJB itself.