Bean WebSphere transaction timeout using EJB timer

With JBoss / Wildfly, you can use the proprietary @TransactionTimeout annotation and determine the transaction timeout for a specific Bean session.

What is the equivalent way to do this with IBM WebSphere ?

We use the EJB Timer and one of the Beans will end in an hour.

Sample code for Wildfly:

 import org.jboss.ejb3.annotation.TransactionTimeout; @Stateless @TransactionTimeout(value=7200) public class TimerBean { } 

Note. Using WebSphere 8.5. Changing the global transaction time is not an option; we need to do this for a specific Bean session, or maybe an application (EAR).

+6
source share
1 answer

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

In this file, specify:

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

Component Transaction Timeout
For a beans enterprise that uses only container-managed transactions, it defines the transaction timeout in seconds for any new global transaction that the container starts on behalf of the bean enterprise. For transactions started on behalf of a component, Setting a component transaction timeout cancels the total default amount of the transaction waiting period that is configured in the service configuration transaction for the application server.

Learn more about setting transaction deployment attributes.

+7
source

Source: https://habr.com/ru/post/981411/


All Articles