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

http://docs.oracle.com/cd/E12839_01/web.1111/e13719/ejb_jar_ref.htm#i1506703

http://docs.oracle.com/cd/E21764_01/web.1111/e13720/annotations.htm#i1438354

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

https://community.jboss.org/wiki/TransactionTimeout

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.