Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-2777

TransactionSynchronization: bound Resource isn't unbound if 'transactionSynchronizationFactory' isn't configured

    Details

      Description

      For reproducing:

      <jdbc:embedded-database id="dataSource" type="H2"/>
      
      	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
      		<property name="dataSource" ref="dataSource" />
      	</bean>
      
      	<int:inbound-channel-adapter id="inboundAdapter" channel="testChannel" expression="'fghfghfg'">
      		<int:poller fixed-rate="1000">
      			<int:transactional/>
      		</int:poller>
      	</int:inbound-channel-adapter>
      
      	<int:logging-channel-adapter id="testChannel" level="FATAL"/>
      
      

      Run it just like this:

      public static void main(String[] args) {
      		new ClassPathXmlApplicationContext("TransactionSyncBug-context.xml", TransactionSyncBug.class);
      	}
      

      The real issue is here SourcePollingChannelAdapter#doPoll():
      The code

      TransactionSynchronizationManager.bindResource(source, holder);
      

      should be moved into if (transactionSynchronizationFactory != null) block
      The similar issue is in the ImapIdleChannelAdapter

        Attachments

          Activity

            People

            • Assignee:
              oleg.zhurakousky@springsource.com Oleg Zhurakousky
              Reporter:
              abilan Artem Bilan
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: