Nov 1, 2018

How to set transaction timeout for Java EE application server

There is a standard way of configuring it so it would depend on the application server. To set it specifically per class or method.

For WebLogic you can specify it in "weblogic-ejb-jar.xml" in the "transaction-descriptor" or use the annotation "@TransactionTimeoutSeconds".

For JBoss AS you could set the transaction timeout using the annotation "@TransactionTimeout" or in "jboss.xml".

To configure timeout for a bean which applies to all its methods, you have to configure the attribute cmt-timeout-in-seconds in glassfish-ejb-jar.xml.

This timeout value is used by all the methods of the bean that initiates a new transaction, not applicable when they join other ongoing transaction.

Also can refer this link for further details on timeout.