Bean Transaction Timeout in WebSphere using EJB Timer
Asked Answered
S

1

7

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

Solemn answered 22/1, 2015 at 17:21 Comment(0)
C
9

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

Chaudoin answered 22/1, 2015 at 21:59 Comment(1)
The reference link is no longer valid; here's a current page for WebSphere 9.0.5: ibm.com/docs/en/was-nd/…Decani

© 2022 - 2024 — McMap. All rights reserved.