Dynamic objects stay in memory with dynamic-new

Posted by gdb390 on 30-Apr-2013 09:51

Hello,

I have a procedure with the following code :

define input  parameter ipcEntityName  as character no-undo.
define input  parameter ipcMethodName  as character no-undo.
define input  parameter dataset-handle  hdsFilters.
define output parameter dataset-handle  hdsData.
define output parameter oplOK          as logical   no-undo.
define output parameter opcReturnValue as character no-undo.

define variable objObject as Progress.Lang.Object no-undo.

if ipcEntityName ne "":u then
do:
  objObject = dynamic-new ipcEntityName().
  if valid-object(objObject) then
  do:
    dynamic-invoke(objObject,ipcMethodName,
                   input dataset-handle hdsFilters by-reference ,
                   output dataset-handle hdsData ,
                   output oplOK,
                   output opcReturnValue).
   
    assign
      hdsFilters = ?.
    delete object objObject no-error.
    assign
      objObject = ?.
  end.
end.

When I run the procedure with the following parameters  :

run ExecuteMethodProxy.p (input "srvr.be.beWagen",

                                         input "GetData",

                                         input dataset dsFilterSettings

                                         output dataset dsWagen,

                                         output vlOK,

                                         output vcReturnValue).

I keep in memory a dataset, a temp-table and buffer for the filter settings dataset.

How can I get rid of that ?

Here is the code of srvr.be.beWagen :

using Progress.Lang.*.



class srvr.be.beWagen:
 
  {inc/dsFilterSettings.i}
  {inc/dsWagen.i}

    method public void getData( input dataset dsFilterSettings, output dataset dsWagen, output oplOK as logical, output opcReturnValue as character ):                   
        
        define variable vcNummerplaat as character    no-undo.
        define variable vcLand        as character    no-undo.        
       
        empty temp-table ttWagen.
       
        assign oplOK            = true
               opcReturnValue   = "":u
               .
       
        for each ttFilterSettings:           
            case ttFilterSettings.ttKey:
                when "NUMMERPLAAT":u then assign vcNummerplaat = ttFilterSettings.ttValue.               
                when "LAND":u        then assign vcLand        = ttFilterSettings.ttValue.               
            end case.
        end.       
       
        if vcLand eq ""
        then assign vcLand = "BE":u.
       
        find first WAGEN
            where WAGEN.FIRMANR     = clnt.mgr.cls.BeContextManager:Instance:FirmaNr and
                  WAGEN.NUMMERPLAAT = vcNummerplaat and
                  WAGEN.land        = vcLand
            no-lock no-error.              
           
        if avail WAGEN then do:
            create ttWagen.
            buffer-copy WAGEN to ttWagen.
        end.                                                
       
        return.

    end method.   
   
end class.

The problem is that I use this so much that on a certain moment, I get error : SYSTEM ERROR : attempt to define too many indexes ... (14675)

Looking at that error number, Progress says all temp tables have to be defined with the NO-UNDO option.

I checked that already ...

Gerd

All Replies

Posted by Stefan Drissen on 30-Apr-2013 11:53

Where are the delete objects on the incoming and outgoing dataset handles? Simply assigning them to unknown is a guaranteed leak.

This thread is closed