For the given class bellow, why the transaction scope is the same from the caller method ? And why it only works when i call, for example someBeanInstance.A()
from another class ?
@Stateless
public class X {
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void A() {
B();
}
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
//or @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void B() {
// here the transaction is the same
// the annotation has no effect
}
}