Announcement Announcement Module
No announcement yet.
Per-ContextSource pooling library Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Per-ContextSource pooling library

    Due to local need I've created a library that allows pooling to be configured on a per-ContextSource basis.

    The design is a PoolingContextSource which uses a commons-pool GenericKeyedObjectPool to manage DirContext instances retrieved from a backing ContextSource. Along with per ContextSource configuration options there is a validation option so bad connections are removed from the pool and are not given to clients. The options are very similar to those provided by commons-dbcp.

    The maven site is available here: and the library can be downloaded here:

    I would like to know if there is any interest in including code such as this in the Spring-LDAP project.

  • #2
    I can see how this type of library might be useful; the built-in connection pooling in Sun's LDAP Provider is a little bit messy and its configuration is really awkward. Also, this might fit in nicely with the client-side transaction support we recently implemented (now available in svn and for download in the nightly builds).

    In order to give an educated guess of whether this would be something to include we'd obviously need to see the code, but as I said it does look interesting at the first glance.


    • #3
      I agree. This looks interesting and we should take a look at it.


      • #4
        Not sure why I didn't post this link originally: That is the full maven2 project.

        The big limitation we ran into with the built in pooling was connection validation. We have 4 LDAP servers behind a layer4 switch. With Sun's pool if a LDAP server drops from the l4 all connections to that server are un-usable but stay in the pool. The additional pooling options provided by commons-pool are just an added bonus.

        One big catch with the pool right now is none of the methods that modify a connection's state or create new sub contexts are supported since they could cause problems with connection consistency. There probably could be logic added to support at least some of the methods but that would be a 'down the road' feature.


        • #5
          There might be a licensing issue here. Your stuff seems to be "owned" by JA-SIG. I can't imagine any Spring source code can contain the copyright notice as stated in the the JA-SIG license.


          • #6
            Thats not a problem, if you're interested in including it in the spring-ldap project I'll get the OK and change the copyright & license over to license spring is using (Apache?). Just let me know and I'll get an updated source zip posted for you.


            • #7
              Cool. I'll take care of the source. Just post to this forum when you have an OK.


              • #8
                I have the OK, the code can be licensed under the same licensed as the spring-ldap code.

                If you need anything else from me please let me know. I'm glad the contribution is going to be included in the library. Any idea of what release it could be part of?


                • #9
                  The source for the validating connection pool is now in the sandbox, converted to Java 1.4.

                  It's too early to say which release it will go in.