In EJB2, you must use the getEJBBusinessObject () method in EJB to pass a reference to itself when calling another (local / remote) bean.
Does the same apply to EJB3 ?
eg.
@Stateless public class MyBean implements MyBeanLocal { @Resource private SessionContext sessionContext; public void myMethod() { OtherBeanLocal otherBean = ...;
Also, if I retrieve my local bean method using the getBusinessObject () method, is it the same as if I used a generic JNDI lookup?
I tested both approaches and both work, but I'm not sure if the bean is handled in the same way by the container.
Edit : Does ejb itself select a link when calling myMethodTwo () from myMethodOne () of the same ejb, is it still needed in EJB3? Is it allowed to call methods inside the same ejb through this link? How will these transactions be handled if I decide to use some?
source share