Advertise with us

Our eBooks

How to increase the Transaction Timeout in JBoss / WildFly

Transaction timeout in WildFly / JBoss can be configured in the transactions subsystem or at EJB level. When the transaction is configured in the transactions subsystem it will be the default transaction timeout for all JTA transactions. When configured at EJB level it will be specific of that EJB.

Configuring Transaction timeout in the transactions subsystem

Out of box, the transactions subsystem does not show the default value of the JTA transaction timeout:

<subsystem xmlns="urn:jboss:domain:transactions:5.0">
    <core-environment node-identifier="${}">
    <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
    <coordinator-environment statistics-enabled="${wildfly.transactions.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
    <object-store path="tx-object-store" relative-to=""/>

The value of default-timeout can be configured through the coordinator-environment element as follows:

<coordinator-environment default-timeout="300"/>

Here is how tou can increase the default transaction timeout with the CLI:

{"outcome" => "success"}

Configuring the Transaction Timeout in EJBs

The transaction timeout can also be configured at deployment level. Here is how to it with the @org.jboss.ejb3.annotation.TransactionTimeout annotation:

import java.util.concurrent.TimeUnit;
import org.jboss.ejb3.annotation.TransactionTimeout;

public class SampleBean 

  @TransactionTimeout(value = 30, unit = TimeUnit.SECONDS)
  public String doSomething() throws RuntimeException

You can also use the jboss-ejb3.xml descriptor to set the transaction timeout:

<jboss:ejb-jar xmlns:jboss=""

On the other hand, if you are using Message Driven Beans, you can set the transactionTimeout as ActivationConfigProperty of your MDB:

@MessageDriven(name = "TestMDB", activationConfig = {
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "testQueue"),
        @ActivationConfigProperty(propertyName = "transactionTimeout", propertyValue="4")
© 2021 All Rights Reserved.

Please publish modules in offcanvas position.