Announcement Announcement Module
Collapse
No announcement yet.
Writing data to Multiple file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by DHGarrette View Post
    You need to get rid of the CompositeItemStream stuff. The CompositeItemStream is trying to manage your FFIW for you. However, this is not what you want. Inside your write() method you are manually opening and closing the FFIW. You do not want the framework to try to open/update/close the FFIW.
    There is a bit progress. Now i am not getting mesage 'Stream already closed' because now i am creating reference of FileItemWriter in the write() method itself, opening it, writing data to it and then closing it.
    Is there a way by which CompositeItemStream can be used to write multiple files where opening/closing of FFIW is managed by framework itself. Each and every time CompanyDTO object comes to the writer a new file should get created.

    Comment


    • #17
      Using ItemStream to have the framework manage opening/closing is the standard way to use Spring Batch. However, this does not apply to your situation. The reason is because the scope of your file is smaller than the write() method. Since you must open and close more than one file within one call to write() there is no way that the framework could do it for you. But you should not consider this to be a problem; you simply have different requirements than the typical batch job.

      Comment

      Working...
      X