BTM
  1. BTM
  2. BTM-71

DualSessionWrapper.createBrowser() does not perform automatic enlistment

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.3
    • Fix Version/s: 2.0.0
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Because of that some standard JMS operations fails with ActiveMQ's XAConnectionFactory

      2010-02-20 17:48:23 DualSessionWrapper [ERROR] error closing XA session
      javax.jms.JMSException: Session's XAResource has not been enlisted in a distributed transaction.
          at org.apache.activemq.ActiveMQXASession.doStartTransaction(ActiveMQXASession.java:109)
          at org.apache.activemq.ActiveMQMessageConsumer.acknowledge(ActiveMQMessageConsumer.java:879)
          at org.apache.activemq.ActiveMQMessageConsumer.dispose(ActiveMQMessageConsumer.java:669)
          at org.apache.activemq.ActiveMQSession.dispose(ActiveMQSession.java:583)
          at org.apache.activemq.ActiveMQSession.close(ActiveMQSession.java:555)
          at bitronix.tm.resource.jms.DualSessionWrapper.stateChanged(DualSessionWrapper.java:156)
          at bitronix.tm.resource.common.AbstractXAStatefulHolder.fireStateChanged(AbstractXAStatefulHolder.java:72)
          at bitronix.tm.resource.common.AbstractXAStatefulHolder.setState(AbstractXAStatefulHolder.java:43)
          at bitronix.tm.resource.jms.DualSessionWrapper.stateChanged(DualSessionWrapper.java:149)
          at bitronix.tm.resource.common.AbstractXAStatefulHolder.fireStateChanged(AbstractXAStatefulHolder.java:72)
          at bitronix.tm.resource.common.AbstractXAStatefulHolder.setState(AbstractXAStatefulHolder.java:43)
          at bitronix.tm.resource.common.TransactionContextHelper.requeue(TransactionContextHelper.java:115)
          at bitronix.tm.resource.jms.DualSessionWrapper.close(DualSessionWrapper.java:132)
          at org.springframework.jms.connection.JmsResourceHolder.closeAll(JmsResourceHolder.java:196)
          at org.springframework.jms.connection.ConnectionFactoryUtils$JmsResourceSynchronization.releaseResource(ConnectionFactoryUtils.java:413)
          at org.springframework.transaction.support.ResourceHolderSynchronization.beforeCompletion(ResourceHolderSynchronization.java:67)
          at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCompletion(TransactionSynchronizationUtils.java:84)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCompletion(AbstractPlatformTransactionManager.java:918)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:716)
          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.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
          at $Proxy11.getPendingMessagesCount(Unknown Source)
      

        Activity

        Hide
        Ludovic Orban added a comment -

        This issue is caused because those two javax.jms.Session methods implemented by DualSessionWrapper do not automatically enlist the session in the transaction:

        javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue) throws javax.jms.JMSException;
        javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String s) throws javax.jms.JMSException;

        Performing enlistment in these methods' implementation should solve the problem.

        A patch for version 1.3.3 needs to be provided as the trunk currently is unstable.

        Show
        Ludovic Orban added a comment - This issue is caused because those two javax.jms.Session methods implemented by DualSessionWrapper do not automatically enlist the session in the transaction: javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue) throws javax.jms.JMSException; javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String s) throws javax.jms.JMSException; Performing enlistment in these methods' implementation should solve the problem. A patch for version 1.3.3 needs to be provided as the trunk currently is unstable.
        Hide
        Ludovic Orban added a comment -

        Fixed both in trunk and 1.3.3 branch

        Tested as working fine by the original reporter.

        Show
        Ludovic Orban added a comment - Fixed both in trunk and 1.3.3 branch Tested as working fine by the original reporter.

          People

          • Assignee:
            Ludovic Orban
            Reporter:
            Stéphane Nicoll
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: