Skip to content
Discussion options

You must be logged in to vote

StepExecution.addFailureException(e) is not a way to persist an exception into the step execution context.

It adds the Throwable to the in-memory StepExecution.failureExceptions list. That list is useful while the step/job is running, but it is not one of the fields stored by the JDBC step execution DAO. The persisted step row contains things like status, counts, exit code, and exit message. The execution context is persisted separately as serializable key/value data.

So after you reload the StepExecution from the repository, seeing an empty failureExceptions list is expected.

If you need the information later, store a serializable summary yourself, for example:

catch (Exception e) {
    if…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Somebodyisnobody
Comment options

Answer selected by Somebodyisnobody
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants