It has a nice API, good documentation, implements all controls and is still actively maintained and improved.
While using it I had a question regarding the usage of connection pools with different identities. I was a bit confused by the API documentation and posted a question to the old forum, which is apparently going to be switched off in the future. As I found the answers of Neil quite helpful I repost the thread here to capture the wisdom:
My initial post:
And Neils response:
My response:
And Neils final answer: |
Most directory-enabled applications that use connection pooling keep the connections authenticated as the same user the whole time, either through the use of something like the proxied authorization control (which is good for fine-grained auditing and access control) or through the use of some generic account (which may be a little easier in some cases, and can give you the flexibility to do access control in your application rather than the directory server). The warnings are primarily intended to make it clear that performing a bind operation will change the identity of the associated connection, so if you later attempt to re-use a connection then you may not know what identity is associated with it and what capabilities that identity might have.
About the only thing that you absolutely shouldn't do when using a pooled connection is something that isn't repeatable (i.e., you can't do more than once on the same connection) or something that isn't reversible (i.e., it could change the state of a connection in a manner that may make it unsuitable for continued use). The StartTLS extended operation is a good example of this because you can only do it once on a given connection and once you have established a secure channel you can't go back to insecure communication. If you want to secure pooled connections using StartTLS, then you'll need to do that with a post-connect processor so that the work is done at the time the connection is created.
If you do anything else with pooled connections that could change the state of those connections, then you need to be aware of that and make sure that you put them in a known state either immediately after checking them out of the pool or immediately before releasing them back. If only a small set of operations may place them in an unknown state, then it's probably better to revert that state before releasing them back to the pool since you only need to do that a subset of the time. However, in your case it sounds like just after checking them out is a better time since the "known state" may vary based on who is accessing the operation.
The other important thing to keep in mind is that if you are going to perform operations using a connection pool that may alter the state of those connections, then you should only interact with that connection pool by checking out and releasing connections. You shouldn't use the methods that are part of LDAPInterface on the pool itself because those methods internally check out a connection, perform the requested operation, and release that connection back to the pool. If connections can be in an unknown state, then the operations performed using them may not behave as expected.