Atomikos Forum |
|
Hi I just started to use Atomikos. I am getting this error. I need help.....
20:16:01,130 ERROR [PreserveCheckedExceptionAspect] Preserving checked exception :org.springframework.transaction.UnexpectedRollbackException: JTA transaction un expectedly rolled back (maybe due to a timeout); nested exception is javax.trans action.RollbackException: The transaction was set to rollback only org.springframework.transaction.UnexpectedRollbackException: JTA transaction une xpectedly rolled back (maybe due to a timeout); nested exception is javax.transa ction.RollbackException: The transaction was set to rollback only at org.springframework.transaction.jta.JtaTransactionManager.doCommit(Jt aTransactionManager.java:1031) at org.springframework.transaction.support.AbstractPlatformTransactionMa nager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionMa nager.commit(AbstractPlatformTransactionManager.java:701) at com.mycomp.aspect.transaction.ConcernTransactionAspect$1.run(C oncernTransactionAspect.aj:179) at com.mycomp.aspect.transaction.ConcernTransactionAspect.ajc$aro und$com_mycomp_aspect_transaction_ConcernTransactionAspect$1$b0a698ca(Con cernTransactionAspect.aj:210) I have this code where we inject the Transaction around the body of the methods using aspectj. (I know we can achieve that using Spring, but we just migrated to Spring). So I do this as part of the inject code DefaultTransactionDefinition def = new DefaultTransactionDefinition(); def.setName("myTX"); def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); def.setTimeout(300); txManager = (PlatformTransactionManager) getApplicationContext().getBean("txManager"); txStatus =txManager.getTransaction(def); _returnValue=proceed(); commit(txStatus);
to increase transaction timeout you may try following
<bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close"> <property name="transactionTimeout" value="290"></property> <property name="forceShutdown"><value>true</value></property> </bean> |