Announcement Announcement Module
Collapse
No announcement yet.
Removing items from the ExecutionContext Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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).

    Comment


    • #3
      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

      Comment

      Working...
      X