There are a number of different ways to approach this problem. I think it all depends on the number of records we are talking about. If you are planning to download a few hundred or an even a few thousand records at a time (with a fairly small record layout of maybe a few kb) then you can use conversational ACI approach. This is how it will work:
Step 1: Server starts up and registers to the Broker
Step 2: Client logon to the Broker and requests data from Server
Step 3: Server start retrieving the data and as the Send-Buffer fills up it send the data to the Client program.
Step 4: The Client starts to receive the data and after it receiving the record set it goes into listen mode again.
Step 5: The Server programs keeps on sending the data in an asynchronous fashion until it has posted all the data.
Step 6: Once the Server program sent all the data it signals to the Client program that it has sent all the data, by ending the conversation with an EOC (End of Conversation).
Step 7: The Client keep on receiving information until it receives an EOC from the Broker. This will be the signal to stop receiving, since all the data has been received.
This process is an asynchronous process, meaning that the Server can keep on sending the data even though the Client might not be ready or might still be busy processing a previous record set. This process works very well and we have been able to achieve very high data throughput.
We have done benchmarks where we were able to transfer thousands of records per second. You could even go as far as to write a multi-threaded client, which would enable you to receive data even faster.
Obviously you have to write more code with this type of approach. You might prefer to use the SQL Gateway and just issue regular SQL commands against the database and receive the data that way. There is nothing wrong in using SQL Gateway to solve your problem.
I think the important thing would be to compare the two scenarios, try them out and see which one works best for you.
I’m attaching some sample Java and Natural code, which should give you a quick start to try the ACI method out.
Regards
Theo
#EntireX#Mainframe-Integration#webMethods