Announcement Announcement Module
No announcement yet.
PoolingContextSource question Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • PoolingContextSource question

    My configuration:
    <bean id="contextSource" class="org.springframework.ldap.pool.factory.Pooli ngContextSource">
    <property name="contextSource" ref="contextSourceTarget" />
    <property name="dirContextValidator" ref="dirContextValidator" />
    <property name="maxActive" value="2" />
    <property name="maxTotal" value="2" />
    <property name="testOnBorrow" value="true" />
    <property name="testOnReturn" value="true" />
    <property name="testWhileIdle" value="true" />
    <property name="whenExhaustedAction" value="1" />


    <bean id="dirContextValidator"
    class="org.springframework.ldap.pool.validation.De faultDirContextValidator" />

    <bean id="contextSourceTarget"
    class=" ontextSource">
    <property name="url" value="ldap://localhost:10389" />
    <!-- property name="base" value="dc=org" / -->
    <property name="userDn" value="uid=admin,ou=system" />
    <property name="password" value="secret" />
    <property name="dirObjectFactory"><null /></property>
    <property name="pooled" value="false"/>

    <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate" >
    <constructor-arg ref="contextSource" />

    I set the maxActive and maxTotal are 2. I expect that when I open 2 browsers and make request to access LDAP, the two connections still exist after the request, when I open the third browser and make request again, I check the connection using 'netstat -ano', I got three connections, I expect two as I set maximun pool size is 2. I am new for Spring, does someone help me understand this? Thanks, Peter.