Dec 7th, 2007, 05:05 AM
handling items with ValidationExceptions
A previous post from Joris Kuipers talked about handling ValidationExceptions and skipping to the next item. In the end he came up with a custom solution of extending RestartableItemProviderTasklet with an ExceptionHandler.
However the replies to the post seemed to imply that there was a fix for the M3 version. I have looked around the M3 code but can see no entry points for handling items with ValidationExceptions - is there such a facility in M3?
Dec 7th, 2007, 04:51 PM
The change in M3 was to make ExceptionHandler responsible for abnormal termination - if an exception is thrown the ExceptionHandler is the one who decides that it should be rethrown. I'm not sure if that has any direct bearing on validation exceptions. There is a Spring Batch ValidationException class. Is that the one you mean, o rare you talking about generic validation problems?
Generally I would expect to be able to skip a validation exception. It might be the case that as things are the only way to do that is to rollback the transaction (which might not be necessary), but other than that I can't see any particular problem. Did you see this thread (http://forum.springframework.org/showthread.php?t=46140) on that topic?