Mule JDBC更新间歇性工作

Mule JDBC更新间歇性工作,jdbc,driver,mule,esb,Jdbc,Driver,Mule,Esb,我需要在一个循环中不断地更新一个表,它在大多数情况下都可以正常工作,但是Mule偶尔会更新一次表,但它没有提交 所以,这里是我的流程。我轮询一个标志为0的表。轮询后,标志设置为5。调用服务后,标志设置为1。但是,如果服务调用失败,该标志将设置回0,以便重新轮询和处理 如果服务中断几分钟,那么这个循环应该一直持续到服务结束。下面的语句工作得很好,但有时它不会更新,循环也会中断 不确定是Mule还是DriverManager问题 <jdbc-ee:outbound-endpoint query

我需要在一个循环中不断地更新一个表,它在大多数情况下都可以正常工作,但是Mule偶尔会更新一次表,但它没有提交

所以,这里是我的流程。我轮询一个标志为0的表。轮询后,标志设置为5。调用服务后,标志设置为1。但是,如果服务调用失败,该标志将设置回0,以便重新轮询和处理

如果服务中断几分钟,那么这个循环应该一直持续到服务结束。下面的语句工作得很好,但有时它不会更新,循环也会中断

不确定是Mule还是DriverManager问题

<jdbc-ee:outbound-endpoint queryTimeout="-1"  queryKey="updateEventReset" connector-ref="DatabaseEvents" exchange-pattern="one-way" doc:name="Database"/>
流量:


我有一个类似的问题,这个问题被证明是一个内部Mule异常。

我看不到你流程中的foreach循环。你打得怎么样?
此异常非常特定于for-each循环。通过重组流程,经过数周的故障排除后,我可以相对轻松地将其整理出来。

您在日志中看到任何异常或错误吗?不,我在日志中看到以下几行。它更新行,但不提交。com.mulesoft.mule.transport.jdbc.sql.command.executor.PreparedSqlCommandExecutor:command已成功执行:update EVENT_TEST set PROCESSED=0,其中PROCESSED=5 com.mulesoft.mule.transport.jdbc.sqlstrategy.UpdateSqlStatementStrategy:Executing sql语句:0行updatedThanks查看此内容。很抱歉,由于格式不正确,我的问题没有完整的ESB流程,我现在修复了它。在流中,我调用另一个WebService,如果调用失败,我将Processed标志设置回0,以便在下一个DB轮询中拾取此DB行。这就是我创建循环的方式。我在第一次拍摄时也没有看到异常,异常可能在Mule流中的其他地方。提交提交提交时不一定会引发异常。顺便说一句:您发布的语句说:正在执行SQL语句:0行已更新-在我看来,这已经是提交消息了。所以基本上更新没有效果。这更像是您编写的SQL语句的问题。可能是where参数错误。。。。很明显,这可能是一个时间问题。当并行执行WebService调用时,可能是它以不同的顺序接收调用,然后发送它们。
<mule>
<spring:bean id="jdbcEASDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
</spring:bean>
<jdbc-ee:connector dataSource-ref="jdbcEASDataSource" name="DatabaseEvents" transactionPerMessage="true" validateConnections="true" queryTimeout="-1" pollingFrequency="10000" doc:name="Database">
    <receiver-threading-profile maxThreadsActive="1"/>
    <jdbc-ee:query key="selectEvent" value="select * from EVENT_TEST where PROCESSED = 0 ORDER BY RowId" />
    <jdbc-ee:query key="selectEvent.ack" value="update EVENT_TEST set PROCESSED = 5 where RowId = #[map-payload:ROWID]" />
    <jdbc-ee:query key="updateEventProcessed" value="update EVENT_TEST set PROCESSED = 1 where RowId = #[flowVars['RowId']]" />
    <jdbc-ee:query key="updateEventReset" value="update EVENT_TEST set PROCESSED = 0 where PROCESSED = 5" />
</jdbc-ee:connector>
<flow name="EventLinkerDBPolling" doc:name="EventLinkerDBPolling" processingStrategy="synchronous">
    <jdbc-ee:inbound-endpoint queryKey="selectEvent" connector-ref="ISeriesDatabaseEvents" doc:name="ACSC Database"/>
    <vm:outbound-endpoint path="vm.toEventWSCall" exchange-pattern="one-way" doc:name="To Event Dining" />
</flow>
<flow name="EventWSProcessing" doc:name="EventWSProcessing" processingStrategy="synchronous">
      <vm:inbound-endpoint path="vm.toEventWSCall" exchange-pattern="one-way" doc:name="Event " >
        <vm:transaction action="NONE"/>
      </vm:inbound-endpoint>
      <set-variable variableName="RowId" value="#[map-payload:ROWID]" doc:name="Variable"/>
  <flow-ref name="ManagerClient" doc:name="Call  Flow Linker" />
      <jdbc-ee:outbound-endpoint queryKey="updateEventProcessed" connector-ref="DatabaseEvents" exchange-pattern="one-way" doc:name="Database"/>
  <catch-exception-strategy doc:name="Catch Exception Strategy">
    <choice doc:name="Choice">
        <when expression="#[ payload.getStatusCode() == 404 ]">
        <processor-chain>
            <jdbc-ee:outbound-endpoint queryTimeout="-1"  queryKey="updateEventReset" connector-ref="DatabaseEvents" exchange-pattern="one-way" doc:name="Database"/>
        </processor-chain>
        </when>
    </choice> 
  </catch-exception-strategy>
</flow>
</mule>