Announcement Announcement Module
Collapse
No announcement yet.
LDAPTemplate.search needs more than 10 minutes to fullfill Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • LDAPTemplate.search needs more than 10 minutes to fullfill

    Hello everybody,

    i have the problem that the filter-search string

    (&(sn=*A*)(givenName=*A*)(userAccount=*AAAAAAA*) ) needs more than 10 minutes to answer and my application service gets a TimeoutException because the response time is too long.

    Here is the code:

    Code:
      public List findByUID(String firstName,String lastName,String accountId) {
          AndFilter filter = new AndFilter();
          final DistinguishedName dn = new DistinguishedName();
          
          if(accountId == null || accountId.equals("") || accountId.indexOf("*") > -1){
        	  filter.and(new WhitespaceWildcardsFilter("sn",lastName))
    		   .and(new WhitespaceWildcardsFilter("givenName",firstName));  
          }else{
        	  filter.and(new WhitespaceWildcardsFilter("sn",lastName))
    			   .and(new WhitespaceWildcardsFilter("givenName",firstName))
    			   .and(new WhitespaceWildcardsFilter("userAccount",accountId));
          }    
          log.debug("DN: "+dn.toString());
          log.debug("Filter: "+filter.toString());
          log.debug("Encodierter Filterstring: "+filter.encode());
          List persons = ldapTemplate.search(dn, filter.encode(), getContextMapper());      
          return persons;
       }
    Output:

    DN:
    Filter: (&(sn=*A*)(givenName=*A*)(userAccount=*AAAAAAA*) )
    Encodierter Filterstring: (&(sn=*A*)(givenName=*A*)(userAccount=*AAAAAAA*) )

    I work with Eclipse ganymede and switched on the debug - modus but this waitng time is in our productive environment as well. Spring version: spring-ldap-1.2.1.jar

    Is it possible that spring converts this search string to another slower search string/query?If i put this filter string directly in the ldap browser it works fine.
    Why does it take so long with this query?

    Did I do something wrong?
    Kind Regards, Nikita

  • #2
    Spring LDAP sends the query straight to JNDI. Try the same query using plain JNDI and see if you get the same behavior.

    Comment

    Working...
    X