Announcement Announcement Module
Collapse
No announcement yet.
Need to use an object in itemProcessor/itemWriter but not persist it. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need to use an object in itemProcessor/itemWriter but not persist it.

    Hi,

    I need to access an object in both itemProcessor and itemWriter but I dont want to persist it in the executionContext. I would read this object in a pre-processing step. What is the best way to do that?

    So far what I have is - I put the object in the jobExecutionContext, then I set the scope of my itemProcessor to "step" and bind a property of the itemProcessor to "#{stepExecution.jobExecution.executionContext }". This does give me access to my object. But I am stuck at two issues with this solution:
    (1) When do I remove the object from the context so that it doesnt stay persisted, it has to be after all the items are done.
    (2) My object could be huge and it seems the column for the context is of size 2500.

    Is this a good solution and if it is, how do I solve the two concerns mentioned above. And if not, is there a good way to do this in spring batch or is caching the best way to go?

    Thanks.
    Last edited by nehakansal; May 1st, 2013, 06:58 PM.

  • #2
    what about using the listeners for chunk/step and review the context params

    Comment

    Working...
    X