JTA事务意外回滚,嵌套异常是javax.transaction.RollbackException

时间:2011-05-09 07:39:20

标签: java spring exception transactions rollback

我得到了UnexpectedRollbackException。这是完整的堆栈跟踪:

org.springframework.transaction.UnexpectedRollbackException: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1031)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
    at com.cmates.userIcon.service.IconUpdaterServiceImpl$$EnhancerByCGLIB$$78838aa7.persist(<generated>)
    at com.cmates.userIcon.service.ScheduledIconUpdaterServiceImpl.doScheduledTask(ScheduledIconUpdaterServiceImpl.java:125)
    at com.cmates.profile.services.IconSyncSingletonImpl.process(IconSyncSingletonImpl.java:121)
    at com.cmates.profile.services.IconSyncJob.executeInternal(IconSyncJob.java:25)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: javax.transaction.RollbackException
    at org.objectweb.jotm.TransactionImpl.commit(TransactionImpl.java:245)
    at org.objectweb.jotm.Current.commit(Current.java:488)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1028)
    ... 13 more
[18 Apr 2011 00:54:00,590] ERROR ErrorLogger - Job (DEFAULT.iconSyncJob threw an exception.

此异常突然开始显示在我的日志中。我的代码没有做任何改动。
我想这可能是因为超时?

2 个答案:

答案 0 :(得分:0)

我在堆栈跟踪中看到提到了一个石英作业。看起来某些东西设置了定期工作,AOP交易管理已经开始了。

答案 1 :(得分:0)

您的交易看起来比交易超时限制更长。您应该增加事务超时限制..

但我不确定,你应该发布更多的堆栈跟踪来了解回滚的原因。