Hi Sapna,
I’ll comment on the general PrgCtxbit…
A PrgCtx object will be kept in the sessioncache until it is bumped out by newly-created sessions.
By default in Content Server 9.7.1, thiscache is 100 sessions, but can be tweaked by setting MaxOpenSessions in the [options]section of the opentext.ini file.
If you do not delete a PrgCtx, it (and allits child temp objects like DSession, USession and WSession) will remain inmemory if anything else still references it.
Items such as DAPINODEs have an internalreference to a DapiCtx which in turn are tied to the DSession of a PrgCtx.
If a PrgCtx is not deleted andinvalidated, the DAPINODEs will be tied to a silent user session.
This is another reason why DAPINODEs themselvesshould never be cached – only their respective DataIDs with which theDAPINODE could be retrieved on a future request.
Regards,
_________________________________________Kyle SwidrovichPrincipal Search / SDK Product SpecialistLivelink Escalations Support TeamOpen Text Corporation275 Frank Tompa Dr.Waterloo, ON, CANADAPhone : +1-800-540-7292Online: http://support.opentext.com_________________________________________
From: eLink Discussion: Development Discussion[mailto:development@elinkkc.opentext.com] Sent: Monday, November 02, 20091:48 PMTo: eLink RecipientSubject: Q around ImpersonatingAdmin in OScript and releasing the prgCtx
Q around Impersonating Admin in OScript and releasing the prgCtx
Posted by sapna.shah (Shah, Sapna) on 2009/11/02 13:35
Hi, In my code, I am impersonating Admin to do certain transactions and then releasing it.. I remember that some folks suggested to delete the prgCtx that I created for Admin and then set to undefined. So say I impersonated Admin and set tmpPrgCtx Dynamic tmpPrgCtx = .ImpersonateAdmin() then after whatever I want to do, I release it. If IsDefined( tmpPrgCtx ) if tmpPrgCtx != prgCtx tmpPrgCtx.Delete() end tmpPrgCtx = undefined end Does anybody know of any negative impact, if I don't delete tmpPrgCtx, but just set it to undefined? If I don't delete, for how long the LL keeps this sessions. or is that when script is executed, it will automatically delete this temporary session handle. The reason I am asking is, in a wf I have a user step that is email enabled.. On completion of step, I have an event script that runs to do certain tasks. Here in the eventscript I impersoante Admin to do the tasks.. Now it so happens that eLink for some reasons doesn't like the my line of code tmpPrgCtx.Delete().. It doesn't delete the email file from temp folder and process the step again if though the step is completed. And hence throws an error email back to user which is not actually an error. Any help around my first problem, or why eLink behaves like this will be greatly appreciated. thanks sapna @ @
When the 101st session iscreated, the 1st session in the list has a .Delete() called againstit and is removed from the list.
If you check out LLIAPI : (LLIAPI Root) :APIObjects : PrgSession.Delete(), you will see what a Delete does (i.e., callingDeletePSession to delete its child objects).
If you just set the value to undefined inyour code, that object (and its children) will stay remain in memory since thePrgSession cache still points to it.
If your only reference to the PrgCtx iscreated and held in a local variable to the script, leaving the script willalready destroy that reference to the PrgCtx, so setting it to undefined willdo nothing in that case.
However, if you cache it or persist itsomewhere (like a global or temp object) and don’t clean up the global ortemp object, those references will live from request to request.
In those cases, not only should you.Delete() the PrgCtx, but you should also clean up the global or temp object sothey don’t point to a non-existent object.
From: eLink Discussion: Development Discussion[mailto:development@elinkkc.opentext.com] Sent: Monday, November 02, 20093:26 PMTo: eLink RecipientSubject: Q around ImpersonatingAdmin in OScript and releasing the prgCtx
Posted by sapna.shah (Shah, Sapna) on 2009/11/02 15:22
In reply to: RE Q around Impersonating Admin in OScript and releasing the prgCtx
Posted by kswidrov (Swidrovich, Kyle) on 2009/11/02 14:48
Hi Kyle, Trying to understand the info you provided.. So if I understand correctly, upto 100 sessions and all objects referenced by it will remain in memory/session cache until say 101st session is created.. Once 101 session is created, it will remove the very first session that is nto being used.. Correct? Once session is removed from memory all its referenced objects will also be removed, correct? So in my code if I don't delete the session but set to undefined, will all the objects that referenced it still exist? Or its of no value to set it to undefined without deleting it? sapna