4

This is my code:

<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 (

I want to understand what is : "exception is not skippable" and how can I make this piece of code to work? Currently, the step is failing leading to termination of the job.

Spring Batch: spring-batch-2.1.xsd

1 Answer 1

1

The exception is a SQL exception - SQLException:

org.springframework.jdbc.UncategorizedSQLException 

Your skip rule only refers to Java.lang exceptions. If you want the SQL exception to be skipped as well, you must also include it in your skip rules. Somewhere in the stack trace it will give you the exact exception which you can then include if you want records which encounter that exception to be skipped. It is recommended that your skip exceptions be more specific so that all your errors are not masked by skipping.

<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> 
Sign up to request clarification or add additional context in comments.

2 Comments

Isn't java.sql.SQLException inherits the java.lang.Exception. Then on escaping java.lang.Exception, this also should get skipped.
In answer to @Panther 's comment, if you look at the original question, that is exactly what I had. So it appears that the inheritance is somehow not incorporated in the skippable. I had to list each exception separately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.