Announcement Announcement Module
No announcement yet.
Unexpected Rollback exception Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unexpected Rollback exception

    I am using Weblogic 9.2 with JTA and XA datasources. I'm using a DefaultMessageListenerContainer running 6 concurrent threads. The MessagListener delegates to a business facade which then executes a method which is transacted. I have very long running transactions so I have increased the JTA timeout value & XA transaction timeout value to 3600 secs. However, I am having a problem during the Commit. I get the following error:

    16:01:11,839 [txMgrMessageListenerContainer-5] ERROR MetadataImporterImpl:171 - TransactionFacade Exception!
    org.springframework.transaction.UnexpectedRollback Exception: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is weblogic.transaction.RollbackException: Could not prepare resource 'JDBC Data Source-0
    Caused by:
    weblogic.transaction.RollbackException: Could not prepare resource 'JDBC Data Source-0
    at weblogic.transaction.internal.TransactionImpl.thro wRollbackException(
    at weblogic.transaction.internal.ServerTransactionImp l.internalCommit(
    at weblogic.transaction.internal.ServerTransactionImp l.commit(
    at weblogic.transaction.internal.TransactionManagerIm pl.commit(
    at weblogic.transaction.internal.TransactionManagerIm pl.commit(
    at org.springframework.transaction.jta.JtaTransaction Manager.doCommit(
    at atformTransactionManager.processCommit(AbstractPla
    at atformTransactionManager.commit(AbstractPlatformTr
    at org.springframework.transaction.interceptor.Transa ctionAspectSupport.commitTransactionAfterReturning (
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:117)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed( :161)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(
    at $Proxy75.execute(Unknown Source)

    I'm using the Spring's Weblogic's Jta transaction manager:

    <bean id="jtaTxManager"
    class="org.springframework.transaction.jta.WebLogi cJtaTransactionManager"

    As you can see in the stack trace Spring's JTA Transaction Manager is attempting to commit the transaction. The exception suggests it may be due to a timeout, but this particular transaction took less than 5 minutes, so I know its not a timeout issue.

    Any help would be appreciated!!
    Last edited by [email protected]; Aug 4th, 2007, 01:11 PM.

  • #2
    The timeout is only a guess by Spring. Your problem is with the data source itself since it says "Could not prepare resource 'JDBC Data Source-0". So you have to find out what causes this. I can't see how we could help with this. I only wonder that you are already in commit phase but the error message talks about preparing. Is in this particular transaction only the JDBC resource involved or also the JMS resource? If it is only one that might explain it, the TXManager could do some optimization then and prepare and commit in one step.



    • #3
      There are 2 JDBC XA datasources involved in this transaaction. However, when I comment out one of the datasources from the transaction, so there is only 1 jdbc XA datasource involved, the transaction commits fine. The other thing I noticed is that very first transaction seems to commit fine, but subsequent commits mostly fail, not all, but most do fail.

      I also noticed by looking at the stack trace is that is doesn't appear to be using WeblogicJtaTransactionManager, but simply a JtaTransactionManager. I don't understand this because I am using the following tx configuration:

      <bean id="jtaTxManager" class="org.springframework.transaction.jta.WebLogi cJtaTransactionManager"/>

      <tx:advice id="txAdvice" transaction-manager="jtaTxManager">
      <!-- the transactional semantics... -->
      <!-- the methods will be wrapped by the tx manager -->
      <tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
      <tx:method name="save*" propagation="REQUIRED" />
      <tx:method name="update*" propagation="REQUIRED" />
      <tx:method name="execute*" propagation="REQUIRED" />
      <tx:method name="add*" propagation="REQUIRED" />
      <tx:method name="processing*" propagation="REQUIRED" >

      <!-- Apply tx mgmt to the service facade -->
      <aopointcut id="txOperation" expression="execution(* com.sonybmg.aoma.transactionmanager.impl.Transacti onFacade.*(..))" />

      <aop:advisor advice-ref="txAdvice" pointcut-ref="txOperation" />

      I'm really stumped here.
      Last edited by [email protected]; Aug 4th, 2007, 04:16 PM.


      • #4
        WebLogicJtaTransactionManager only overwrites some particular methods from JtaTransactionManager which probably explains the latter to be in the stacktrace.

        To the error itself: I can't help you much. You need to find out what causes the error. Is it really the complete stacktrace? Are you sure you are using XADataSources? It's nearly impossible to guess what's going wrong.



        • #5
          Ok, turns out we had a problem with a transaction that was suspended, waiting to be committed or rolledback. Once the DBA manually rolled back the transaction, everything seems to be working fine. Thanks for your help.