4

JTA transaction unexpectedly rolled back (maybe due to a timeout); the nested exception is

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

I get an timeout exception due to JPA: how can I increase the time needed for the transaction?

Where should I include the parameter to resolve this?

I am using tomcat 7.

1
  • 1
    I could be wrong, but I don't think JTA is a feature of Tomcat 7, it has been added to your Tomcat 7 environment. You'll have to figure out what your JTA implementation is and either read the docs or update your question here with more relevant information. Commented Aug 25, 2013 at 13:42

1 Answer 1

5

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

If you're using Atomikos (which I believe is what most people use with Tomcat), you can set that via the com.atomikos.icatch.max_timeout property or via the com.atomikos.icatch.default_jta_timeout property. This property can be set either via a JVM command line parameter, or via Spring Integration (described here).

More information about the configuration (JTA) properties for Atomikos can be found here.

If you're using Bitronix, you can add a bitronix-default-config.properties file to your classpath, and then add a bitronix.tm.timer.defaultTransactionTimeout=<value> line to that file. See here for more info.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.