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.
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.
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.
Thanks Simon, that's what I was expecting.