Calling subprogram recursively with Java wrapper

I’m calling a Natural subprogram using the Java wrapper. The Natural program is setup to send 24 records at a time. Since my Java program needs to retrieve more than 24 records, I need to call the program recursively until I get all of the data. It works fine when I call the routine from the workbench using the “Generate and run test” option. When I try calling it recursively from my Java program, it receives only the first 24 every time. Is there a simple way or example to demonstrate how this can be accomplished?

You have two options to address this issue:
1) You can make use of conversational RPC in order to return the complete result set to the Java client program. For more information on how to do this, please refer to the EntireX documentation. Start with the following section:

2) Your second option is to include an additional parameter, which would be your restart value. Your subprogram can populate this parameter with the next record to be returned. You Java client will then make sure that this restart value is sent to the Natural subprogram when you do the next call and the next set of records will be returned to you.


Where can I find some more documentation/examples on what you have suggested?

You can view the documentation:

Unfortunately I don’t have a conversational RPC example. I’ll see whether I can find one for you.