Send/receive dynamic dataset to/from AppServer - cleanup nee

Posted by Lieven De Foor on 08-Mar-2018 05:18

Hi,

We have a procedure that is run by the client on AppServer, having a parameter like:

DEFINE INPUT-OUTPUT PARAMETER DATASET-HANDLE DynamicDataset.

The dataset goes back and forth between client and server.

Does this object need to be deleted on the AppServer side before returning to the client to prevent memory leaks?

Or is this done automatically? Or not needed at all?

e.g.

DEFINE INPUT-OUTPUT PARAMETER DATASET-HANDLE DynamicDataset.

/* CRUD actions on dataset here */

FINALLY:

    DELETE OBJECT DynamicDataset. /* Is this needed? */

END FINALLY.

Posted by Simon L. Prinsloo on 08-Mar-2018 05:30

Yes, you do need to delete it.

If you create it yourself, you can put it in a widget pool, otherwise it will go into the session unnamed widget pool. But when a dataset is passed as a parameter and received as a dynamic dataset, as in this case, it is always created in the Session unnamed widget pool of the receiver (in your case, the AppServer) and if you do not delete it, it will stay there until the widget pool is deleted when the session ends.

If you explicitly delete it and it is an OUTPUT or INPUT-OUTPUT parameter, the delete will be deferred until after the parameter was passed.

All Replies

Posted by Simon L. Prinsloo on 08-Mar-2018 05:30

Yes, you do need to delete it.

If you create it yourself, you can put it in a widget pool, otherwise it will go into the session unnamed widget pool. But when a dataset is passed as a parameter and received as a dynamic dataset, as in this case, it is always created in the Session unnamed widget pool of the receiver (in your case, the AppServer) and if you do not delete it, it will stay there until the widget pool is deleted when the session ends.

If you explicitly delete it and it is an OUTPUT or INPUT-OUTPUT parameter, the delete will be deferred until after the parameter was passed.

Posted by Lieven De Foor on 08-Mar-2018 05:35

Thanks Simon, that's what I was expecting.

Posted by Peter Judge on 08-Mar-2018 07:14

You can also validate that you’re deleting everything (or at least what you’re expecting to) by running the LOG-MANAGER with the “TEMP-TABLES” log-entry-type.

This thread is closed