Bean Transaction Timeout in WebSphere using EJB Timer

梦想与她 提交于 2021-02-07 13:38:36

问题


With JBoss/Wildfly one is able to use the @TransactionTimeout proprietary annotation and define a transaction timeout for a specific Session Bean.

What is the equivalent way of doing it using IBM WebSphere?

We are using EJB Timer and one of the Beans will over an hour to complete.

Sample code for Wildfly:

import org.jboss.ejb3.annotation.TransactionTimeout;

@Stateless
@TransactionTimeout(value=7200)
public class TimerBean {

}

Note: Using WebSphere 8.5. Modifying the global transaction time is not an option, we need to do it for a specific Session Bean, or maybe an Application (EAR).


回答1:


Yes, it is possible. You can set it via transaction-time-out in custom extension ibm-ejb-jar-ext.xml file.

In that file define:

<session name="TimerBean">
        <global-transaction transaction-time-out="7200"/>
</session>

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



来源:https://stackoverflow.com/questions/28094890/bean-transaction-timeout-in-websphere-using-ejb-timer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!