Jun 1st, 2012, 04:29 AM
batch processing with initialization
Hello, I'm new to Spring batch so please take no offence if I ask something stupid
I'm writing an import process that reades input from a table and writes output to several other tables. I think I should implement the ItemReader and ItemWriter interfaces, and wire them together using Spring Batch.
My 'challenge' here is that because the import-table isn't purged when the job is finished to be able to refill the other tables from scratch. The import-table is equiped with a timestamp to indicate which records should be processed. However, that means that the ItemReader implementation has some state in order to know where it left off the previous read() or the previous time the job was executed, and a timestamp alone is not finegrained enough to ensure all records are processed.
My question is, what would you recommend doing to get this state knowledge?
- purge the table anyway, moving the records to a differente table?
- update another 'state' table indicating timestamp/record?
- where would this responsibility be implemented? In the ItemReader or ItemWriter or somewhere else?
thanks in advance,
Jun 1st, 2012, 05:47 AM
I think also implementing ItemStream can help me out here.