Results 1 to 3 of 3

Thread: Removing items from the ExecutionContext

  1. #1

    Default Removing items from the ExecutionContext

    Hello,

    I am using the ExecutionContext for 2 purposes:
    1) Storing values for restarting a tasklet step
    2) Storing job output (I simply add MSG[xxxx] messages to the ExecutionContext)

    This strategy works fine when the job doesn't crash. But when I have to restart the job, I would like a way to remove the MSG[xxxx] entries from the old run - eg. an ExecutionContext.remove() method.

    Would it be posible to add such a method, or is there another simple way to return the job output without using the ExecutionContext?

    Best regards
    Preben

  2. #2

    Default

    As a workaround for removing entries from execution context you can set the values to null or some special constant and check the values (rather than using containsKey).

    You can start a JIRA for adding the remove method and see how it turns out - I see nothing wrong with supporting remove(key).

  3. #3

    Default

    Quote Originally Posted by robert.kasanicky View Post
    You can start a JIRA for adding the remove method and see how it turns out - I see nothing wrong with supporting remove(key).
    Created JIRA: http://jira.springframework.org/browse/BATCH-728

Tags for this Thread

Posting Permissions

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