Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bean Transaction Timeout in WebSphere using EJB Timer

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).

like image 976
Evandro Pomatti Avatar asked Jan 22 '15 17:01

Evandro Pomatti


1 Answers

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

like image 159
Gas Avatar answered Oct 06 '22 19:10

Gas