Oracle provides an initialization method that will automatically run when the package is first accessed within a session. My question, is there a method that gets called when the session ends?
The reason I am asking this is because I have a package that connects to LDAP. I have been having trouble because in batch jobs it is easy to overload on the number of connections. Something about the unbind does not execute and free the session right away.
To that end I am making a change to allow for the session to have just one connection, but it is possible someone does not call the close routine (to unbind). So, I was wanting a way to insure that the close routine would automatically get called at the end of the session.
--example of the initialization method
create or replace package body LDAP_Valmont is
ldap_session DBMS_LDAP.SESSION;
Session_Open BOOLEAN;
procedure SetSessionVariables is
begin
Session_Open:= FALSE;
end;
begin
SetSessionVariables;
end;