Results 1 to 10 of 19

Thread: Rollback of chunk on exception

Threaded View

  1. #11
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    Quote Originally Posted by MisterX View Post
    Configuring an ExceptionHandler for the StepOperations does the trick.
    OK. I made it a bit easier (look in SVN or in tonight's snapshot) by adding the step operations to the step configuration (so you don't have to change the StepExecutor). So ChunkOperationsStepConfiguration is now called RepeatOperationsStepConfiguration and it allows you to set the step operations as well as the chunk operations.

    Do you think that the ExceptionHandler on SimpleStepConfiguration should go at the step level (not the chunk level as it does now)? It seems like this is the more likely scenario for common exception handler strategies.

    But I don't understand what you mean when you say that the items should be skipped.
    If the exception is thrown in the ItemProcessor (or anywhere in the Tasklet if the Tasklet is Skippable and passes the message down to the ItemProvider - this is the case for the ItemProviderProcessorTasklet) the item will be marked in the InputSource as skipped and will not be presented again to the processor.

    Additionally, is there a way to repeat the processing of the successfully processed items which have not been committed because of the rollback of the transaction?
    That should be automatic if your ExceptionHandler in the step operations does not rethrow - the transaction will be repeated and all the unskipped items (the ones that did not fail) will be processed.

    N.B. this is still not true for some failure modes using Hibernate-based ItemProcessors, until we fix or find a workaround for BATCH-194 - the item cannot be skipped because the exception came outside the Tasklet execution.
    Last edited by Dave Syer; Nov 22nd, 2007 at 05:12 AM. Reason: spelling

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •