我试图理解当我们在jdbc出站网关中使用任何insert或update语句时,提交是如何工作的,有时我们会看到进程标志没有更新,任何输入都会非常有帮助
<int-jdbc:outbound-gateway id="update.gateway"
request-channel="request.channel" reply-channel="reply.channel"
data-source="dataSource" request-sql-parameter-source-factory="spelSource"
update="update table set PROCESS_FLAG=:processFlag where QUEUE_VALUE=:queueValue and
JOB_ID=:jobId ">
</int-jdbc:outbound-gateway>发布于 2014-10-21 20:32:53
如何使用wpap将您的流发送到Transaction
假设我们在开始时有一个<gateway>,您可以像这样启动它:
public Bar service(Foo foo) {
return this.gateway.store(foo);
}因此,用@Transactional标记该方法就足够了。
从另一方面看,<int-jdbc:outbound-gateway>有<request-handler-advice-chain>。你可以把tx:advice放在那里
<int-jdbc:outbound-gateway>
<int-jdbc:request-handler-advice-chain>
<tx:advice>
<tx:attributes>
<tx:method name="*"/>
</tx:attributes>
</tx:advice>
</int-jdbc:request-handler-advice-chain>
</int-jdbc:outbound-gateway>无论如何,需要事务才能获得DB UPDATE的正确结果。
https://stackoverflow.com/questions/26486016
复制相似问题