I have a stateless bean something like:
@Stateless
public class MyStatelessBean implements MyStatelessLocal, MyStatelessRemote {
@PersistenceContext(unit
I haven't tried it yet (I'm about to), but an alternative to injecting a self-reference via the @EJB
annotation is the SessionContext.getBusinessObject()
method. This would be another way to avoid the possibility of a circular reference blowing things up on you - although at least for stateless beans injection does seem to work.
I'm working on a large system in which both techniques are employed (presumably by different developers), but I'm not sure which is the "correct" way to do it.