Consultor Eletrônico



Kbase P10729: Temp-table persists after the procedure which defines it goes out of scope
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/19/2004
Status: Verified

FACT(s) (Environment):

Progress 9.1D

SYMPTOM(s):

Passing the handle of a temp-table as a parameter

The temp-table, although not dynamic, persists after the procedure which defines is goes out of scope

CAUSE:

This is expected behavior.

When a procedure or function that passes TEMP-TABLE data as a parameter is called, it will either pass this data with OUTPUT TABLE <tablename> or with OUTPUT TABLE-HANDLE hTableHandle.

Passing by table name just passes the contents of the temp-table. Passing by table-handle passes both the contents and the structure of the temp-table and it works fine if the temp-table is fully dynamic.

However, it all falls apart if the table-handle points to a static temp-table (ie. one that has been built using the DEFINE TEMP-TABLE syntax).

In this scenario, when OUTPUT TABLE-HANDLE hTableHandle is used, the 4GL automatically creates a dynamic buffer to store the floating copy of the temp-table structure. But the same 4GL explicitly precludes from doing DELETE OBJECT on what it regards as a static object. So it is left with this unwanted buffer hanging around in memory until the session ends, whether it is liked or not.

FIX:

Provide DELETE OBJECT hTableHandle after finished using the Temp-table.

Otherwise the buffer that contains the temp-table structure and one-record buffer space remains locked in memory until the end of the Progress session (either client or AppServer -- makes no difference).