Results 1 to 2 of 2

Thread: Writing to the multiple databases

  1. #1
    Join Date
    Apr 2009
    Posts
    14

    Default Writing to the multiple databases

    I have a requirement to load a file in two different databases. Is there any way to have multiple writers in single Step? Or i have to configure this as two seprate jobs.

  2. #2
    Join Date
    Dec 2005
    Location
    Lyon, France
    Posts
    311

    Default

    you can have multiple writers for the same step by using a composite writer, but as each writer will write to its own database and Spring Batch uses the same transaction manager for a whole batch, you'll need to use JTA transactions (or use a feature like synonyms to let the database engine demarcate transactions on both databases). This will also coupled the writers together (a failure for one will imply a rollback for both).

    Perhaps you should use 2 different jobs, especially if the writes on each writer should be decoupled.

Posting Permissions

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