Announcement Announcement Module
Collapse
No announcement yet.
PoolingContextSource question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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>

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

    <bean id="contextSourceTarget"
    class="org.springframework.ldap.core.support.LdapC 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>
    <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate" >
    <constructor-arg ref="contextSource" />
    </bean>
    ...


    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.
Working...
X