Hello,
I'm getting some interesting transaction behavior on Direct Channels. Here's what I'm doing:
1. Read from a File and write to a Direct Channel.
2. Start a Chain
3. Perform Database Operation X - ServiceActivator(@Transactional)
4. Perform Database Operation Y - ServiceActivator(@Transactional)
5. End Chain
I'm just using the default transaction attributes. If Step 4 throws a RuntimeException, it doesn't seem to rollback the database operation performed by Step 3. I can't seem to figure out why that would happen? I appreciate any inputs. Thanks.
Here's my configuration:
Code:<int-file:inbound-channel-adapter id="SOME.ADAPTER.ID" prevent-duplicates="false" directory="${EDIFACT.SRC.DIRECTORY}" scanner="recursiveScanner" filename-pattern="*.xml" channel="SOME.DIRECT.CHANNEL" > <int:poller id="DEFAULT.POLLER" default="true"> <int:interval-trigger fixed-rate="true" interval="${POLL.INTERVAL}" /> </int:poller> </int-file:inbound-channel-adapter> <int:channel id="SOME.DIRECT.CHANNEL"/> <int:chain input-channel="SOME.DIRECT.CHANNEL" output-channel="SOME.QUEUE.CHANNEL"> <int:service-activator ref="fileLockService" method="obtainFileLock"/> <int:service-activator ref="fileLockService" method="test"/> </int:chain> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" />


Reply With Quote