5

I am using Hibernate and Atomikos for JTA for one of my proof of concepts. I am getting a JTA transaction unexpectedly rollback exception, maybe due to a timeout. The exception is:

javax.transaction.RollbackException: Prepare: NO vote

Walls
  • 3,972
  • 6
  • 37
  • 52
user3926825
  • 51
  • 1
  • 3

2 Answers2

5

This error occurs if a transaction is requested to commit but has already been rolled back due to a timeout. So your assumption is totally right. The solution is to increase the transaction timeout.

jeha
  • 10,562
  • 5
  • 50
  • 69
  • how can you do that. I have a similar question at https://stackoverflow.com/questions/45282120/change-jta-transaction-timeout-from-default-to-custom I have tried all options but I am still getting the error. – Manglesh Aug 08 '17 at 13:30
0

You can increase the timeout for a transaction using spring configurations, for e.g. by declaring transactional.properties file with value,

com.atomikos.icatch.max_actives=100
com.atomikos.icatch.log_base_name=atomikos-log
com.atomikos.icatch.log_base_dir=transaction-logs-dir/
com.atomikos.icatch.registered=true
com.atomikos.icatch.default_jta_timeout=10000
com.atomikos.icatch.max_timeout=20000