tags:

views:

6

answers:

0

I need to write a job in which i have to read the database 2 times.

First query returns only one record and i need to send this record as the header of my flat file.
Second query returns a set of records that i need to write in same flat file.

I tried to create a compositewriter for it and within that i provided two flatFileItemWriter and set same resource name for both the flatFileItemWriters. But this is resulting in a error that resource alread exists.

Can anyone tell me the approach that i should follow.

Thanks in advance.