Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: Spring integration flow and XA transactions

  1. #21
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    Regarding the issue,
    Code:
    14:17:13.101 [xaQueueListener-4] INFO  c.a.jms.AtomikosJmsNonXaSessionProxy - atomikos non-xa session proxy
    for vendor instance com.tibco.tibjms.TibjmsxSessionImp@1549ceb: WARNING - detected JTA transaction context 
    while using non-transactional session.
    Any reason for defining both and using them?

    Code:
    <bean id="jmsConnection" class="com.tibco.tibjms.TibjmsQueueConnectionFactory"
              p:serverUrl="tcp://localhost:7222" p:userName="admin"
              p:userPassword=""/>
    
    
        <bean id="xaJmsConnection" class="com.tibco.tibjms.TibjmsXAConnectionFactory"
              p:serverUrl="tcp://localhost:7222" p:userName="admin"
              p:userPassword=""/>
    instead just use com.tibco.tibjms.TibjmsXAQueueConnectionFactory

    I can't start transaction without poller. Is It correct behaviour or my configuration mistake?
    What poller are you referring to? You have a message-driven-channel-adapter which doesn't require a poller sub element. The transaction are demarcated by the transaction-manager attribute or the one confugured with the container in your case.

    Below is the line from the documentation regarding message-driven-channel-adapter

    The poller sub-element is not applicable for a message-driven Channel Adapter, as it will be actively invoked.
    Are things working as you are expecting them to, or you still are facing problems?

  2. #22
    Join Date
    Feb 2010
    Posts
    22

    Default

    Ok. Let's talk about simple scenario

    context.xml(fragment)

    Lets make assumption - myTransformer throw exception. I expect that transactions of flow will be rollbacked. But It didn't happened. database is not rolled back.

    What do I need to fix in flow for transactions rollbacking?

    Code:
        <tx:annotation-driven transaction-manager="txManager"/>
    
    
        <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
            <property name="dataSource" ref="dataSource"/>
        </bean>
    
        <jdbc:embedded-database id="dataSource" type="H2">
            <jdbc:script location="classpath:db-schema.sql"/>
        </jdbc:embedded-database>
    
    
        <int:channel id="in">
        </int:channel>
    
        <int:channel id="transformChannel"/>
    
        <int:channel id="out">
            <int:queue capacity="10"/>
        </int:channel>
    
    
        <int-jdbc:outbound-gateway
                update="insert into message (id, message) values (1,'Hello')"
                request-channel="in" reply-channel="transformChannel" data-source="dataSource"/>
    
    
        <int:transformer input-channel="transformChannel" output-channel="out" ref="myTransformer"/>
    
        <bean id="myTransformer" class="org.stuff.MyTransformer">
        </bean>

  3. #23
    Join Date
    Feb 2010
    Posts
    22

    Default

    Guys. I really need advice.

  4. #24
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    641

    Default

    Hello

    DataSourceTransactionManager isn't XA, so you can't use it with JMS...

    And with following with your sample above: Who places the message in the in channel? You should start transaction here.

    Cheers,
    Artem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •