Yes! the problem was 'no-rollback with empty class' until now I've been working with that but since the moment I put retryable config it stopped working so I just delete no-rollback and it works!
what I want to achieve is If a database server fall down, restart or something like that my process retry sql query until the server goes online again.
What I'm seein weird now is altough I wrote this:
Code:
<batch:step id="procesa" next="fin" >
<batch:tasklet task-executor="taskExecutor" transaction-manager="transactionManager" >
<batch:chunk reader="aparatoReader" processor="aparatoProcess"
writer="aparatoWriter" commit-interval="5"
retry-limit="200"
>
<batch:retryable-exception-classes>
<batch:include class="java.sql.SQLException"/>
</batch:retryable-exception-classes>
</batch:chunk>
<batch:listeners>
<batch:listener ref="taskListener"/>
</batch:listeners>
</batch:tasklet>
</batch:step>
And in my itemReader something like this:
trials++;
if (trials < 2 ) {
throw new SQLException("Connection failed");
} else {
doread....
}
The process first throw the exception but second time success doing read, process and write. However it doesn't continue with the next step of the job and the listener show me this:
15/05/2011 13:43:30 INFO Job: [FlowJob: [name=finanzas]] completed with the following parameters: [{}] and the following status: [FAILED]
Say failed when it should be a success.