Spring integration spring集成:intjdbc:出站网关提交?
我试图理解当我们在jdbc出站网关中使用任何insert或update语句时,commit是如何工作的,有时我们会看到进程标志没有更新,任何输入都会非常有用Spring integration spring集成:intjdbc:出站网关提交?,spring-integration,Spring Integration,我试图理解当我们在jdbc出站网关中使用任何insert或update语句时,commit是如何工作的,有时我们会看到进程标志没有更新,任何输入都会非常有用 <int-jdbc:outbound-gateway id="update.gateway" request-channel="request.channel" reply-channel="reply.channel" data-source="dataSource" request-
<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>
wpap如何处理您的事务流 假设我们在一开始就有一个
public Bar service(Foo foo) {
return this.gateway.store(foo);
}
因此,用@Transactional标记该方法就足够了
从另一边来的。您可以将tx:advice:
无论如何,需要事务才能获得正确的数据库更新结果。另请参阅其他启动上游事务的方法。如果我使用上述代码段,它是否会负责事务提交,此外,我还试图了解在出站网关中看不到任何事务属性时的默认行为,这取决于您的DB供应商。请参阅其文档:不使用事务时的行为是什么。在大多数情况下,DB在第一个DML子句INSERT、UPDATE等时启动本地TX,但没有保证何时提交/回滚。
<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>