Please consider the following scenario:
{code}
@Stateless
public class FooServiceBean implements FooService, BarService {@TransactionAttribute(value=TransactionAttributeType.NOT_SUPPORTED)
public void myMethod1() {
//code here
}
}
@Local
public interface FooService {
...
}
public interface BarService {
public void myMethod1();
}
{code}
If we invoke myMethod1(), will the method run outside of a tx or not? i.e. is the instance managed by the EJB container or not? I'm seeing behavior that suggests otherwise in my current JBoss 4.2.x app. It is actually running in a tx (in this case a distributed tx b/c there are multiple datasources that are being queried via multiple DAOs). In effect, the NOT_SUPPORTED tx attribute is being ignored. Please advise. thx.
I don't know how it works in AS 4.x. But the later spec compliant versions (like AS 5.x and AS 6.x) won't even allow you to cast the JNDI proxy to BarService, since that's not exposed as a business interface.