Results 1 to 2 of 2

Thread: How to shared the same instane of one object with two steps diferents?

  1. #1
    Join Date
    Jun 2009
    Location
    Brazil
    Posts
    10

    Default How to shared the same instane of one object with two steps diferents?

    Friends.

    Now I have de below context.

    Processor in the STEP1 I create an object (PSURs) that the property has a list and add items to it.

    But now the processor in the STEP2 I need to add items to this list (PSURs) or make additions to existing items.

    To do this in my STEP2 I need to use the same instance of the object (PSURs) created in the processor STEP1.

    You know how I can share the same instance of an object between two different steps?

  2. #2
    Join Date
    Apr 2008
    Posts
    174

    Default

    Well... it may not be the recommended way... but have you tried defining your object PSURs as a bean in your job.xml and tried injecting it into your reader/writer (of each step) whichever adds the items to it??

    Make sure to make your bean a singleton and spring should take care of it.

Posting Permissions

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