Consultor Eletrônico



Kbase P69199: Delete of dynamic temp-table or dataset not always postponed
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   24/01/2011
Status: Verified

SYMPTOM(s):

Delete of a temp-table object is not always postponed if table-handle is passed as output table-handle

temp-table received as output table-handle parameter of another procedure

temp-table passed correctly if dataset is deleted in "main block" of called procedure

Dataset not passed if dataset is deleted in (sub)procedure called from called procedure where table-handle parameter is defined

FACT(s) (Environment):

Progress 9.1x
OpenEdge 10.x
All Supported Operating Systems

CAUSE:

When passing a dynamic temp-table as an output table-handle parameter, a DELETE OBJECT statement should be executed for the temp-table before control is passed back to the calling procedure to prevent memory leaks.

If this is done, the actual delete of the temp-table will be postponed until it has actually been passed back to the calling procedure, but only if the DELETE OBJECT statement occurs in the same procedure as the OUTPUT TABLE-HANDLE parameter is defined.
If the called procedure in turn calls another procedure and this other procedure contains the DELETE OBJECT statement, the temp-table will be deleted immediately and will not be passed back to the original calling procedure.

FIX:

Ensure temp-table is always deleted on the procedure level where the temp-table parameter is defined, and not on lower procedure levels.