Setting timeout in JTA configuration

JTA operation unexpectedly rolled back (possibly due to a timeout); the nested exception is

javax.transaction.RollbackException: The transaction was set to rollback only 

I get a timeout exception due to JPA: how can I increase the time it takes for a transaction?

Where should I enable the option to resolve this?

I am using tomcat 7.

+4
source share
1 answer

The parameter you want to change is the maximum timeout for your JTA transaction.

If you use Atomikos (which, in my opinion, most people use Tomcat), you can set this through the com.atomikos.icatch.max_timeout property or through the com.atomikos.icatch.default_jta_timeout property. This property can be set either using the JVM command-line option or through Spring Integration (described here ).

More information on configuration properties (JTAs) for Atomikos can be found here .

If you are using Bitronix, you can add the bitronix-default-config.properties file to your class path and then add the line bitronix.tm.timer.defaultTransactionTimeout=<value> to this file. See here for more information.

+5
source

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


All Articles