Try OpenEdge Now
skip to main content
Programming Interfaces
Audit Policy Maintenance APIs : API overview : Using the generic utility and caching APIs with an AppServer
 

Using the generic utility and caching APIs with an AppServer

The generic utility and caching APIs support execution on an AppServer. They provide functions to define the AppServer connection to be used when a local database is not present. The functions that read data from or write data to a database forward their requests to the AppServer whenever they detect that the database is not local. For AppServer execution, you can only call the procedures in the caching or generic utility APIs directly, as they are the only APIs that are AppServer aware.
If you want to call any of the other standalone procedures directly, your code needs to handle the forwarding of requests to the AppServer. For example, in the following combination of pseudo-code and ABL, the caller handles the AppServer connection:
DEFINE VARIABLE hAppSrv AS HANDLE    NO-UNDO.
DEFINE VARIABLE hDSet AS HANDLE    NO-UNDO.
DEFINE VARIABLE cError AS CHARACTER NO-UNDO.

CREATE SERVER hAppSrv.
hAppSrv:CONNECT("-AppService asbroker1 -H localhost- S 5162").

RUN auditing/_get-policies ON hAppSrv
  ("sports2000", OUTPUT DATASET-HANDLE hDSet, OUTPUT cError).