posted 11 years ago
Hi all,
I'm reasonably experienced with Spring and have done several Batch projects before, but I'm facing a new situation and I'm not sure how to implement for it. The situation is this:
This Batch Project requires querying SFDC for data from a stage table and then making a second query to pull the real data later on based on the results of the first. So the point where I'm stuck is, how exactly to go about implementing the ItemReader for this. The first query (ID Query) is basically pulling back a bulk load of ID's based on some parameters and could be a load of a few hundred ID's.
Basically, how do I set up my ItemReader to make this query, pull back the set of ID's, and then pass them back correctly without sticking them into some kind of collection object and passing back the collection? It's my understanding that the ItemReader returns the items being read in 1 at a time, so if I pull back 100 in a single query, how do I go about parsing these back with the Item Reader?
Also, I'm aware that their is a limit on how many results an SFDC Query can return in one go (200 if I'm not mistaken) or at least the instance we are working with has this limit. Say there were 300 records, how should I go about ensuring proper chunking of the results so that I can get all 300? I know it could be hacked together to say, pull 200, then set the status of those 200 to in-process and then query again... but that just doesn't strike me as the best way to do this.
I'd appreciate any help and advice I can get. Examples are always best but I'm more or less stuck on what is the best way to implement this.
Thank you in advance.