Asynchronous Requests from Multiple AppServers

Hi all,

Our company has a number of locations which each have their own database locally.

HQ have asked me to develop a report which is basically a consolidation of information held in each factory database (e.g. overview of price trends).

Each factory has an appserver I can connect to so I can write code that will work as follows:

connect factory1-appserver.
run build details on factory1-appserver (input-output ttReport).
disconnect factory1-appserver.

connect factory2-appserver.
run build details on factory2-appserver (input-output ttReport).
disconnect factory2-appserver.

connect factory3-appserver.
run build details on factory3-appserver (input-output ttReport).
disconnect factory3-appserver.

This will run and has the advantage that when finished I have full consolidated data. The disadvantage is the speed in that each query can take up to 5 minutes (and there are 6 locations to run against).

This got me looking at asynchronous appserver calls but I am unsure how this can be achieved for a couple of reasons.

- I assume that I will have define 6 seperate temp-tables and then consolidate them once all requests are complete.

- I can't see any way of dynamically connecting to the AppServers (i.e. let the user pick 3 of the 6 locations). I was hoping to hold the factory details in a database and be able to add/remove locations without the need for changing code but I am not sure if the AppServer handle can be defined dynamically. Obviously, the appserver cannot be disconnected until the asynchronous request is complete and has called it's EVENT-PROCEDURE.

Hope this makes sense - am new to asynchronous calls so any help would be appreciated.
 
Hi

I do not know how much data you are talking about but if faced your problem then I would create a small program that
- connected to appserver (name and connection taken from input parameter)
- run the build details.
- dump ttrecords to a file (one file for each site)
- close connection

Run this program six times in batch run (I believe it is -b)

create a program that read all six files and create a full report.
delete the files after use.
 
Look at the

RUN xx ON server ASYNCHRONOUS EVENT-PROCEDURE "callbackproc1" .

Statement.

This will call your app server method and continue running your other statement after. Once the appserver response comes in it will call the procedure "callbackproc1" . You can find more info on this in the ABL reference for the RUN Statement.
 
Back
Top