Thanks for your answer.
Yes, this is true. I've thought about doing it this way.
But the problem is (and I guess it would be same with "onError()") that I will know that a error happened, but no way to know where it happened.
For example, here is a process:
Code:
try{
//Call the service_1
}
catch(Throwable e){
//Call to service Log("Error in service 1")
}
try{
//Call the service_2
}
catch(Throwable e){
//Call to service Log("Error in service 2")
}
Do you know if there is way to "block" the transaction of Spring Batch, catching the exception, doing some process, forwarding the exception ?
I've tried, this works for "normal" Exception but not for RuntimeException.
I've put the transaction of log service as NOT_SUPPORTED so that it won't be concerned by SpringBatch Transaction but still doesn't work. But maybe this problem has nothing to do with Spring batch....
Anyway, I'm going to try with "afterStep()". But if you have any idea, it will be very welcome.
Thanks.