I would like to know if the EJB container has impact on method calls withing an EJB. I’m not sure if @TransactionAttributes annotations or any other annotation has effect in this case or not. If it has, how it is implemented in the container?
@Stateless
public class MyBean {
public void doSomething() {
// logic
doSomethingElse();
// logic
}
@TransactionAttribute(TransactionAttributeType.NOT_SUPORTED)
public void doSomethingElse() {
// logic
}
}
Plain java call to doSomethingElse() is not handled by the container. If you want to make an “EJB-call” then you should use SessionContext.getBusinessMethod(…):