Last post Aug 02, 2011 08:00 AM by gww
Jul 29, 2011 02:23 PM|justsnafu|LINK
I have some code that allows administrators to manage their organization's users/groups etc and execute extended commands (such as disabling accounts etc). This code is completely separate from the main user application and is only accessible by admins.
As such I connect to LDAP using the admin user so I have access to all the commands I need.
What I'm wondering is if I can simply instantiate my LdapConnection, then bind to the server and then cache that connection for use throughout the app (store it in the Application object or in Session for instance) rather than instantiating it and binding every
time I need to make a call? In other words, does that LdapConnection object ever expire or timeout or unbind after a certain amount of time? It looks like it has a 'Timeout' property on the connection object but that appears to be per each individual call.
Am I correct to assume that once I bind I can just keep using that connection? Any design reason not to do this?
Aug 02, 2011 08:00 AM|gww|LINK
I couldnt find anything on it being done that way. My guess is it would time out eventually. You could put a check in your code to see if the connection object still exists when it is called and recreate it if it does not. I am unsure about performance issues
with keeping the connection open.
My question is what would happen if you make a call and its not able to complete it for some reason and never times out.