简体   繁体   English

在JTA配置中设置超时

[英]Set Timeout in JTA configuration

JTA transaction unexpectedly rolled back (maybe due to a timeout); JTA事务意外地回滚(可能是由于超时); 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? 由于JPA,我收到超时异常:如何增加交易所需的时间?

Where should I include the parameter to resolve this? 我应该在哪里包含参数来解决这个问题?

I am using tomcat 7. 我正在使用tomcat 7。

The parameter that you want to change is the maximum timeout for your JTA transaction. 要更改的参数是JTA事务的最大超时。

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. 如果您正在使用Atomikos(我相信大多数人使用Tomcat),您可以通过com.atomikos.icatch.max_timeout属性或通过com.atomikos.icatch.default_jta_timeout属性进行设置。 This property can be set either via a JVM command line parameter, or via Spring Integration (described here ). 可以通过JVM命令行参数或通过Spring Integration( 此处描述)设置此属性。

More information about the configuration (JTA) properties for Atomikos can be found here . 有关Atomikos配置(JTA)属性的更多信息,请访问此处

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. 如果您使用的是Bitronix,则可以将bitronix-default-config.properties文件添加到类路径中,然后将bitronix.tm.timer.defaultTransactionTimeout=<value>行添加到该文件中。 See here for more info. 有关详细信息,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM