• No replies
10 Posts

Pinned topic how to .. problem implementing custom readerr

‏2013-02-28T19:33:51Z |
I am new to batch and trying to determine the best practice way of implementing mycustom reader. Specifically how to handle the results.

Specifically I query a non jdbc source for some results . how to implement iterating through the resultset

Option 1. Use open () to get all the query results (presumably all in memory) and read() along with hasNext() to iterate through results and get my objects one after the other ... this is what I think I am doing now

Option 2. Is there a mechanism to pull the results one at time without pulling all the results and corresponding big objects in memory via open()/initialize. This will avoid all the memory usage for all the results
I am using option 1 and still testing but looks to be working..... I would have thought option 2 will be more in keeping with batch ....if I understand things correctly

Any working examples to review ?
Thanks in advance