0

i have a transactional poller (spring 3.1.2 and spring-integration 2.2.3) to ensure that messages will be redelivered if the transaction is rolled back by an exception

    <int:outbound-channel-adapter id="obca" ref="notificationHandler" 
        method="handle" channel="notificationChannel" >
        <int:poller max-messages-per-poll="100" fixed-delay="6000"
            time-unit="MILLISECONDS">
            <int:transactional isolation="DEFAULT" />
        </int:poller>   
    </int:outbound-channel-adapter>

this works fine when unit testing with an H2 database, the message is redelivered as long as the method throws an exception

   @Transactional
   public void handle(Message<MyPayload> message)

but when i use the sql-server we use in production (ms-sqlserver, which uses READ COMMITTED SNAPSHOT as isolation level if that is important) the redelivery on exception does not work. any hints why this may be?

EDIT:

i tested with TRACE logging but couldn't find suspicious log messages, finally i got it to work. i declared a separate dataSource(same config as normal database) and transactionManager org.springframework.jdbc.datasource.DataSourceTransactionManager instead of my normal org.springframework.orm.jpa.JpaTransactionManager.

cproinger
  • 2,258
  • 1
  • 17
  • 33
  • Turn on TRACE level logging for `org.springframwework`; you should see copious log messages about transaction management. – Gary Russell May 07 '13 at 13:14
  • the READ COMMITTED SNAPSHOT does not seem to be the problem, i tested it against a db with just read-committed set and it doesn't work either – cproinger May 07 '13 at 16:00

0 Answers0