Requesting large datasets using EntireX (Java)

We are trying to evaluate how useful EntireX is in our Java applications for requesting a large number of records from Adabas. Let’s say that I have a large report printing on the client that is requesting thousands of records. I need to create my java stubs, and then possibly another routine which may have to iteratively select smaller buffers of the data. I’m more used to the SQL world where I call a stored procedures, and voila - data. It seems like so much work with EntireX. Are there better solutions like a JDBC driver or SQL Gateway where I can send SQL calls and get the data?

I guess at this point, I see the value in EntireX in calling Natural subprograms to retrieve and update small recordsets and not retrieving large amounts of records.

Somebody have some light to shed?

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.


The forum won’t allow me to upload the file. I’ll see whether we can resolve the issue. Once we did I will upload the example code for you.


Here is the example code as promised.

Let me know if you have any questions to upload the Natural code into your Natural environment.

Java Data Transfer with (5.58 KB)

Hi Theo,
Would you be able to send me a sample java for this subject as you told above?


paul - if you are logged into the forum, you will be able to download the attachment.