繁体   English   中英

Spring Batch - 异常不可跳过

[英]Spring Batch - exception is not skippable

这是我的代码:

<chunk reader="READER" writer="WRITER"
    commit-interval="1000" skip-limit="1000">
    <skippable-exception-classes>
        <include class="java.lang.Exception"/>
    </skippable-exception-classes>
</chunk>

Log Stacktrace:

org.springframework.batch.retry.ExhaustedRetryException: Retry exhausted after last attempt in recovery path, but exception is not skippable.; nested exception is org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [ MERGE INTO FHD_GTGT_GEN_TXN_X TXN USING (

我想了解什么是:“异常不可跳过”,我怎样才能使这段代码工作? 目前,该步骤失败导致作业终止。

Spring Batch: spring-batch-2.1.xsd

例外是SQL异常 - SQLException:

org.springframework.jdbc.UncategorizedSQLException 

您的跳过规则仅涉及Java.lang异常。 如果您还希望跳过SQL异常,则还必须将其包含在跳过规则中。 在堆栈跟踪的某处,它将为您提供确切的异常,如果您希望跳过遇到该异常的记录,则可以包含该异常。 建议您的跳过异常更具体,以便跳过时不会掩盖所有错误。

<chunk reader="READER" writer="WRITER"
 commit-interval="1000" skip-limit="1000">
  <skippable-exception-classes>
     <include class="java.lang.Exception"/>
     <include class="java.sql.SQLException"/>
  </skippable-exception-classes>
</chunk> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM