【发布时间】:2012-12-04 14:53:57
【问题描述】:
让我拥有带有 CMT 的 Stateless bean。我在 bean 中有 3 个方法,2 个使用 TransactionAttributeType.REQUIRED。并且这两种方法都是从第三种方法调用的。我如何检查交易何时处于活动状态?我要检查
@Stateless
@TransactionManagement(TransactionManagementType.CONTAINER)
public class MyBean
{
public RetType methodA()
{
methodB();
//.... is CMT active there?
methodC();
}
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public RetType methodB(){}
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public RetType methodC(){}
}
【问题讨论】:
标签: java jakarta-ee transactions ejb-3.0