Results 1 to 2 of 2

Thread: Creating JobParameters during a Job?

  1. #1
    Join Date
    Jun 2010
    Posts
    13

    Default Creating JobParameters during a Job?

    Hi,

    The Problem:

    We are writing a program in spring batch with 2 processes; one to refresh all 4 tables with data parsed from XML and the other to update the tables, deleting them if necessary and inserting new data.

    So far we can programmed a refresh, we managed to create the SQL parameters for the the job: the date, the table and the SQL query(which will just be an insert all the time because the tables will be truncated before completely rewritten.)

    The second process is a bit of a problem, the XML when requesting updates from a certain date, has another tag included regarding whether the data for the row was updated or deleted, now as I have to read the XML to figure out
    whther it is a delete or insert statement I need I cant pass them as JobParamters to the job.

    How can I create the query depending on whether an update or delete query and pass it to the writer on the fly as it were.

    Any Advice is much appreciated
    Cheers

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    If I understand correctly it seems the update takes place in a second step, so it doesn't make much sense to try and keep all the information you need for it in memory from the first step. Can't you store a flag in the database on the first pass (either in the records themselves or in a join table)? Or refactor into a single step?

Posting Permissions

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