【发布时间】:2014-05-24 16:09:06
【问题描述】:
我的 jdbc-inbound-adapter 有以下配置:
<si-jdbc:inbound-channel-adapter id="jdbcInboundAdapter"
channel="queueChannel" data-source="myDataSource"
auto-startup="true"
query="SELECT * FROM STAGE_TABLE WHERE STATUS='WAITING' FOR UPDATE SKIP LOCKED"
update="UPDATE STAGE_TABLE SET STATUS='IN_PROGRESS' WHERE ID IN (:Id)"
max-rows-per-poll="100" row-mapper="rowMapper"
update-per-row="true">
<si:poller fixed-rate="5000">
<si:advice-chain>
<ref bean="txAdvice"/>
<ref bean="inboundAdapterConfiguration"/>
</si:advice-chain>
</si:poller>
</si-jdbc:inbound-channel-adapter>
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="get*" read-only="false"/>
<tx:method name="*"/>
</tx:attributes>
</tx:advice>
我的问题是 select 和 update 语句是否会在同一个事务中执行。
在 spring-integration 文档中,它没有明确指定使用建议链时的交易。 (我使用的是spring-integration-jdbc-2.2.0.RC2.jar) 请参阅第 18.1.1 节轮询事务支持: http://docs.spring.io/spring-integration/docs/2.0.0.RC1/reference/html/transactions.html
【问题讨论】: