LDAP Pooling Configuration for KIM

The LDAP data source that you supply are injected into a Spring PoolingContextSource bean which is in turn injected into the KIM Identity Service.

Here is a table of the pre-defined properties fed into PoolingContextSource

Property

Parameter

maxActive

ldap.pool.maxActive

maxTotal

ldap.pool.maxTotal

maxIdle

ldap.pool.maxIdle

maxWait

ldap.pool.maxWait

whenExhaustedAction

ldap.pool.whenExhaustedAction

testOnBorrow

ldap.pool.testOnBorrow

testOnReturn

ldap.pool.testOnReturn

testWhileIdle

ldap.pool.testWhileIdle

timeBetweenEvictionRunsMillis

ldap.pool.timeBetweenEvictionRunsMillis

numTestsPerEvictionRun

ldap.pool.numTestsPerEvictionRun

minEvictableIdleTimeMillis

ldap.pool.minEvictableIdleTimeMillis

You can configure LDAP pooling using either of the following methods:

  1. Set all parameters yourself
    classpath:edu/ucdavis/myapp/config/client-config.xml
    <config>
        ...
        <param name="ldap.pool.maxTotal">-1</param>
        ...
        <param name="ldap.pool.testOnBorrow">true</param>
    </config>
    
  2. Tell KIM Identity Service to use default properties while you set one or more parameters
    classpath:edu/ucdavis/myapp/config/client-config.xml
    <config>
        ...
        <param name="config.location">classpath:META-INF/common-config-defaults.xml</param>
        <param name="config.location">classpath:edu/ucdavis/iet/kuali/rice/kim/config/default-properties.xml</param>
        ...
        <param name="ldap.pool.testOnBorrow">true</param>
        ...
    </config>
    

    At minimum, you must set ldap.pool.testOnBorrow to true, or else the PoolingContextSource won't be validating any connections in the pool.

  3. Tell Rice to use default properties using Spring while you set one or more parameters
    classpath:edu/ucdavis/myapp/config/application-common.xml
    <bean id="config" class="org.kuali.rice.core.config.spring.ConfigFactoryBean">
        <property name="configLocations">
            <list>
    	    <value>classpath:edu/ucdavis/iet/kuali/rice/kim/config/default-properties.xml</value>
                <value>classpath:edu/ucdavis/myapp/config/client-config.xml</value>
    	</list>
        </property>
    </bean>
    
    classpath:edu/ucdavis/myapp/config/client-config.xml
    <config>
        ...
        <param name="ldap.pool.testOnBorrow">true</param>
        ...
    </config>