How to set EJB timeout period ?
EJBs support two types of transaction management: Container managed and Bean managed. Container managed transactions provide a transactional context for calls to bean methods, and are defined using Java annotations or the deployment descriptor file ejb-jar.xml. Bean managed transactions are controlled directly using the Java Transaction API (JTA) .
In both cases, you can set the Transaction Timeout for your EJBs using annotations or XML descriptors.
Check this tutorial to learn more about it: How to increase the Transaction Timeout in JBoss / WildFly
On the other hand, if you want to learn more about the JTA Transaction Timeout, we recommend the following reading: Configuring Transactions (JTA) using JBoss / Wildfly
JBoss AS 5
If you are using an older version of the application server, you can set the transaction timeout in the jboss-service.xml file ( available in the conf directory)
<mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
name="jboss:service=TransactionManager">
<attribute name="TransactionTimeout">300</attribute>
<attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute>
</mbean>
Modify the TransactionTimeout attribute as you need.
Note: The timeout attribute is in seconds not in milliseconds !
Recommended Articles
Configure Stateful Bean Timeout Policies in WildFly 20
Learn how to configure timeout policies for EJBs, including Stateful and Singleton beans, in WildFly 20. Discover how to set default timeouts, access timeouts, and passivation timeouts.
Call an EJB from another application in WildFly using EJB Lookup
Learn how to invoke EJBs from a remote EJB Client using WildFly's EJB lookup feature. This tutorial covers the steps for creating an EJB server project, setting up security, and configuring dependencies.
Mastering JBoss AS and WildFly EJB Annotations: A Comprehensive Cheat Sheet
Discover the power of EJB annotations on JBoss AS and WildFly, from caching to security. Learn how to configure pool sizes, passivation, timeout, and more.
EJB to EJB Communication in a Cluster with WildFly 31
Learn how to set up EJB communication between a cluster of WildFly servers and an EJB client, enabling dynamic view of the cluster topology.