在事务中打开新事务时提交
|
使用Ejb3.0,Weblogic 11g,JDBC
我正在调用在另一个部署EAR中远程运行的方法。
远程部署中的方法被调用,但是带有
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
问题是在远程方法被调用之前,我在数据库中所做的所有逻辑都不会提交,直到远程方法完成为止。
我愿意做的是一次承诺,使“之前”逻辑发生,并且当我在远程调用后返回时继续正常进行。
任何想法?
一些代码来解释:
@CallByReference
@Stateless(mappedName = \"ejb/OperatorProccessBean\")
@Local({ OperatorProccessBeanLocal.class })
@Remote({ OperatorProccessBeanRemote.class })
public class OperatorProccessBean implements OperatorProccessBeanLocal,
OperatorProccessBeanRemote
{
...
SBNDispatchBeanRemote SBNDispatchBean = (SBNDispatchBeanRemote) context.lookup(\"ejb/SBNDispatchBean#com.mirs.sbn.dispatch.SBNDispatchBeanRemote\");
if (SBNDispatchBean == null)
{
logger.error(TAG + \" SBNDispatchBean is null\");
}
else
{
//until here I want all my data to be commited without waiting for the upcoming remote method to finish
SBNDispatchBean.updateSubscriberInBlockingList(...);
}
...
}
现在方法updateSubscriberInBlockingList()
注释为
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
我希望在调用该方法之前先提交数据。
提前致谢,
射线。
没有找到相关结果
已邀请:
2 个回复
寇剩
寿柬窟年