spring integration jdbc inbound poller在使用无效列类型的更新查询时失败

时间:2015-08-19 15:13:08

标签: spring-integration

我们正在使用以下配置来轮询db表来选择行,一旦这些行被选中,我们想要将其状态更新为其他内容,以便在下次轮询时不会再次获取。这是配置,在更新查询失败时显示错误消息

引起:java.sql.SQLException:列类型无效

<int-jdbc:inbound-channel-adapter
    auto-startup="true" channel="pollingChannel"
    query="$select id,status from test_table where status='ready'"
    data-source="dataSource"
    id="pollingChannelAdapter"
    row-mapper="testRowMapper"
    update="update test_table set status='picked' where id in (:id)"
    update-per-row="true"
    >

    <int:poller default="false" id="poller" max-messages-per-poll="1" fixed-rate="1000"/>
</int-jdbc:inbound-channel-adapter>

1 个答案:

答案 0 :(得分:2)

找到修复程序。我必须使用在value对象中定义的适当属性,因为我正在使用行映射器将select查询响应解析为某个没有名为&#34; id&#34;的属性的值对象。一旦我改变了一个,它开始工作正常。

相关问题