我有一个带有 bean 管理事务的无状态 bean,以及这样的方法:
@Stateless
@TransactionManagement(TransactionManagementType.BEAN)
public class ... {
@Resource
private UserTransaction ut;
@EJB
private OtherStatelessBeanLocal other;
public void invokeSomeMethods()
ut.begin();
...
// invoke other bean's methods here.
other.method();
...
ut.commit();
}
}
那么如何UserTransaction
传播到OtherStatelessBeanLocal
bean?