Atomikos Forum

The transaction was set to rollback only

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);
JamesBond Send private email
Thursday, February 12, 2009
 
 
Hi,

The transaction merely timed out - try increasing the timeout value.

HTH
Guy Pardon Send private email
Thursday, February 12, 2009
 
 
I increased the timeout value, but I don't think timeout is causing this as because it happens very fast.

thanks
JamesBond Send private email
Thursday, February 12, 2009
 
 
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>
Nimit Shah Send private email
Monday, February 16, 2009
 
 
Thanks, I tried that but still the same error. No matter how much I increase I still get the same error

thanks
JamesBond Send private email
Monday, February 16, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics