Results 1 to 3 of 3

Thread: LdapTemplate.authenticate and PoolingContextSource

  1. #1
    Join Date
    Feb 2006
    Posts
    4

    Default LdapTemplate.authenticate and PoolingContextSource

    I have a question.

    I have successfully used this new way of authenticating using Spring LDAP ldapTemplate.authenticate(userId, password), and it works great. However, I was wondering if it would be more performant to use a PoolingContextSource, similar to pooling database connections.

    After I added the PoolingContextSource, I was happily greeted with a UnsupportedOperationException. This is because the getContext(principal, credentials) is not supported. So does this mean that it would not be beneficial to pool LDAP connections when using this new api method? If it would be beneficial from a performance standpoint, to pool the connections, could you offer some advice on how to go about doing that?

    Thanks in advance for any help you are able to contribute.

  2. #2
    Join Date
    Jul 2005
    Location
    Helsingborg, Sweden
    Posts
    504

    Default

    For the benefit of other forum readers, I'll post Mattias answer to the same question on our team blog:

    There’s actually a very simple explanation for this. In order to authenticate the user the ContextSource will perform an LDAP ‘bind’ operation, which means creating a new connection to the server using the specified user DN and password. This obviously means that these connections cannot be pooled.

    Now, this is one of the use cases that LDAP is specifically designed for; LDAP connections are very lightweight, so you should be all right anyway.
    Ulrik Sandberg
    Jayway (www.jayway.com)
    Spring LDAP project member

  3. #3
    Join Date
    Feb 2006
    Posts
    4

    Default

    Thanks ulsa....

    I appreciate the quick response.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •