Announcement Announcement Module
No announcement yet.
Launch multiple instances of Job at same time Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Launch multiple instances of Job at same time


    I´ve been googling and checking previous posts, but no luck, so I try plan B and I create a new one (sorry).

    I´m developing a web app which create some reports by reading from a database. For example, one user make a request to generate all invoices between two dates, spring launch a job, read from database, process data, write some files, and send then to the user.

    This is OK and work fine, but I will have multiples users making multiples request, each one with different parameters (although indeed is de same Job). Doing so, I get NullPointerException in my proccesor. I think this is because it´s not thread safe and two or more threads are modifying/initializing the same properties of the class.

    All of my beans participating in the job have scope step, so they would be created in every instance of the job.

    So, my question is, Is posible isolate two instances of the same job? This would be as if any instance runs in its own sand-box.

    I´m using Spring 3.2 and Spring batch 3.2.


  • #2
    Sorry for not getting to this sooner. We are in the process of moving to StackOverflow for our forums.
    This question is probably a better candidate for StackOverflow, perhaps against the #spring-batch tag. If you do post it there, please reply here with the link. Thanks!