使用EJB Timer的WebSphere中的Bean事务超时 [英] Bean Transaction Timeout in WebSphere using EJB Timer
问题描述
使用JBoss/Wildfly,可以使用@TransactionTimeout
专有注释并为特定的Session Bean定义事务超时.
With JBoss/Wildfly one is able to use the @TransactionTimeout
proprietary annotation and define a transaction timeout for a specific Session Bean.
使用 IBM WebSphere 的等效方法是什么?
What is the equivalent way of doing it using IBM WebSphere?
我们正在使用EJB Timer,其中一个Bean将在一个多小时内完成.
We are using EJB Timer and one of the Beans will over an hour to complete.
Wildfly的示例代码:
Sample code for Wildfly:
import org.jboss.ejb3.annotation.TransactionTimeout;
@Stateless
@TransactionTimeout(value=7200)
public class TimerBean {
}
注:使用WebSphere 8.5.修改全局事务时间不是一种选择,我们需要针对特定的Session Bean或应用程序(EAR).
推荐答案
是的,有可能.您可以通过transaction-time-out
在自定义扩展名ibm-ejb-jar-ext.xml
文件中进行设置.
Yes, it is possible. You can set it via transaction-time-out
in custom extension ibm-ejb-jar-ext.xml
file.
在该文件中定义:
<session name="TimerBean">
<global-transaction transaction-time-out="7200"/>
</session>
组件事务超时
对于仅使用容器管理的事务的企业bean,请为任何新的全局事务指定事务超时(以秒为单位) 容器代表企业启动的事务 豆角,扁豆.对于代表该组件启动的交易, 组件事务超时设置将覆盖默认总数 事务中配置的事务生存期超时 应用程序服务器的服务设置.
Component Transaction Timeout
For enterprise beans that use container-managed transactions only, specifies the transaction timeout, in seconds, for any new global transaction that the container starts on behalf of the enterprise bean. For transactions started on behalf of the component, the Component Transaction Timeout setting overrides the default total transaction lifetime timeout that is configured in the transaction service settings for the application server.
For more details check Configuring transactional deployment attributes
这篇关于使用EJB Timer的WebSphere中的Bean事务超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!