Announcement Announcement Module
Collapse
No announcement yet.
Unexpected Rollback exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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(TransactionImpl.java:1782)
    at weblogic.transaction.internal.ServerTransactionImp l.internalCommit(ServerTransactionImpl.java:331)
    at weblogic.transaction.internal.ServerTransactionImp l.commit(ServerTransactionImpl.java:227)
    at weblogic.transaction.internal.TransactionManagerIm pl.commit(TransactionManagerImpl.java:273)
    at weblogic.transaction.internal.TransactionManagerIm pl.commit(TransactionManagerImpl.java:267)
    at org.springframework.transaction.jta.JtaTransaction Manager.doCommit(JtaTransactionManager.java:842)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.processCommit(AbstractPla tformTransactionManager.java:662)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.commit(AbstractPlatformTr ansactionManager.java:632)
    at org.springframework.transaction.interceptor.Transa ctionAspectSupport.commitTransactionAfterReturning (TransactionAspectSupport.java:314)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:117)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :161)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    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"
    scope="singleton">
    </bean>


    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.

    Joerg

    Comment


    • #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... -->
      <tx:attributes>
      <!-- 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" >
      </tx:attributes>
      </tx:advice>

      <aop:config>
      <!-- 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" />
      </aop:config>



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

      Comment


      • #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.

        Joerg

        Comment


        • #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.

          Comment

          Working...
          X