[progress Communities] [progress Openedge Abl] Forum Post: Re: Accessing Temp-tables &...

  • Thread starter Thread starter Peter Judge
  • Start date Start date
Status
Not open for further replies.
P

Peter Judge

Guest
They will need to be available to the session /AVM used for a request. Then you can return them as if they were any other data. How to make and keep them available from the startup procedure is a topic for some discussion but probably the simplest least bad way is to add a function into the session startup procedure - call it GetData() - that returns a HANDLE or TABLE- or DATASET-HANDLE to the data. The session startup proc runs persistently throughout the life of the agent/session and you can use this to your advantage. In your appserver request.p , get the handle to the startup.p. define variable hClientPrincipal as handle no-undo. define variable hStartupProc as handle no-undo. hStartupProc = session:first-procedure. do while valid-handle(hStartupProc) and hStartupProc:name ne 'BusinessLogic/Startup.p': hStartupProc = hStartupProc:next-sibling. end. Do something like the above and make sure you have the name right :D Now you can call your GetData call assign hBuffer = dynamic-function('GetData' in hStartupProc))). When calling the GetData() call make sure to not perform deep copies and cause memory leaks. See the BY-REFERENCE keyword and similar techniques (passing handles etc). There are other ways that add global state (using shared constructs etc) but whether you choose those approaches depends on your app architecture and your design principles and feelings about global state. Mine is generally that it’s bad and to avoid as far as possible.

Continue reading...
 
Status
Not open for further replies.
Back
Top