Announcement Announcement Module
Collapse
No announcement yet.
Pooling SpringLDAP donīt respect maxTotal Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pooling SpringLDAP donīt respect maxTotal

    Hello
    Guys,

    Itīs my first message here.
    Iīm very satisfied with springldap about high productive of development.
    Today on my company we have a intranet where exists a section to search the others employees.
    This search was implemented with springldap and last week we catch this errors:

    "org.springframework.dao.DataAccessResourceFailure Exception: Failed to borrow DirContext from pool.; nested exception is org.springframework.ldap.ServiceUnavailableExcepti on: oidgvt:389; socket closed; nested exception is javax.naming.ServiceUnavailableException: oidgvt:389; socket closed
    at org.springframework.ldap.pool.factory.PoolingConte xtSource.getContext(PoolingContextSource.java:397)
    at org.springframework.ldap.pool.factory.PoolingConte xtSource.getReadOnlyContext(PoolingContextSource.j ava:374)"


    Ok, the number of connections in the pool of the spring is greater than the number of connections that support OID, then we specify the parameter maxTotal on springldap.xml.

    Here is a problem, after run many tests with new configuration SpringLDAP donīt respect maxTotal.
    First we specify 30 connections 'maxTotal' then simulate 20 users accessing the intranet and various consulting contacts.

    The number of connections at LDAP grown absurdly :
    netstat -a | grep 13060 | grep EST | wc -l
    1000 connections

    in TIME_WAIT
    netstat -a | grep 13060 | grep TIME_WAIT | wc -l
    200 connections

    Strange no?
    Somebody help me about this behavior?

    Iīm using springldap 1.2.1

    Here is my springldap.xml
    <bean id="contextSourcePooled"
    class="org.springframework.ldap.pool.factory.Pooli ngContextSource">
    <property name="contextSource" ref="contextSourceTarget" />
    <property name="dirContextValidator" ref="dirContextValidator" />
    <property name="testOnBorrow" value="true" />
    <!--
    valida antes de utilizar
    -->
    <property name="testWhileIdle" value="true" />
    <!--
    valida enqto disponivel no pool
    -->
    <property name="maxWait" value="10" />
    <!--
    tempo espera miliseconds
    -->
    <property name="maxActive" value="10"/>
    <!--
    tamanho do pool
    -->
    <property name="maxTotal" value="30" /><!-- Max de conexoes q pool ira criar -->
    </bean>
    Last edited by ramilani12; Mar 19th, 2010, 03:41 PM.

  • #2
    The pooling support uses Apache commons-pool under the hood. They have recently released a significant update in version 1.5.4. My first recommendation would be to switch to that version of the library and re-run your testing. Also turning up logging for the org.springframework.ldap.pool might give some additional hints for what is going on.

    Comment


    • #3
      Hello edalquist.

      Yes, I updated the last version of commons-pool and springldap.
      On my tests the "pool" works fine.

      Comment


      • #4
        Are you saying that upgrading to the latest commons-pooling and Spring LDAP solved your problems?

        Comment


        • #5
          apparently yes, on my tests the last version of commons-pool manage better the pool with ldap

          Comment

          Working...
          X