Results 1 to 2 of 2

Thread: Updating database while writing to flat files

  1. #1

    Default Updating database while writing to flat files

    Hi,

    I am using a flat file writer to write a flatfile, mean while i will also have to update couple of fields in database for the
    respective records.

    I am already using a classifier to identify the correct writer, 1) java writer that processes some business logic
    2) flat file writer that writes content to a file.

    i am able to update status as a part of java writer by invoking a dao for that corresponding record.
    i need to update the status in case of flat file writer

    the configuration of flatfile writer is part of xml config.

    what is the best way to update the DB in case (2) ?

  2. #2
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    351

    Default

    Take a look at the CompositeItemWriter. You can use that to write to multiple ItemWriters with the same items.
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

Posting Permissions

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