Spring Integration: Jdbc-inbound-adapter is it transactional when using adice-chain -


i have below configuration jdbc-inbound-adapter:

    <si-jdbc:inbound-channel-adapter id="jdbcinboundadapter"     channel="queuechannel" data-source="mydatasource"     auto-startup="true"     query="select * stage_table status='waiting'  update skip locked"     update="update stage_table set status='in_progress' 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> 

my question both select , update statements executed in same transaction.

in spring-integration documentation not specify transaction when advice-chain used. (i using spring-integration-jdbc-2.2.0.rc2.jar) please see section 18.1.1 poller transaction support: http://docs.spring.io/spring-integration/docs/2.0.0.rc1/reference/html/transactions.html

you using old version (and release candidate @ that, not ga release. current version 3.0.2.release latest 2.2.x 2.2.6.release. please upgrade 1 of those.

http://projects.spring.io/spring-integration/

yes, it's done in same transaction.

are referring old documentation too? current documentation says

"a important feature of poller jdbc usage option wrap poll operation in transaction,..".

the transaction started, message source invoked (to results) , downstream flow occurs in transaction (unless hand off thread, in case transaction commit @ time).

in fact, update done right after select (and before message sent), commit doesn't occur until downstream flow complete.

your channel called queuechannel; if queue channel, means transaction commit message stored in queue.

if feel documentation improvements required, please open jira issue.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -