I have found that there is a problem which limits the number of searches you
can perform.
Once you exceed 32768 search, all ldap searches fail with error 85.
(Timeout)
Has anyone else experienced this issue?
Once LDAPConnThread - RequestEntry.id > 32768 you see the issue.
code snippet....
for (int i = 0; i < 50000; i++) {
try {
ld = ldapPool.getConnection();
LDAPSearchResults res = null;
LDAPEntry findEntry = null;
String[] attr = { "cn" };
String filter = "(&(objectclass=person)(" + user + "))";
LDAPSearchConstraints cons = new LDAPSearchConstraints();
cons.setTimeLimit(6000);
res = ld.search("", LDAPv2.SCOPE_SUB, filter, attr, false, cons);
if (res.hasMoreElements()) {
findEntry = res.next();
String userDN = findEntry.getDN();
}
ldapPool.close(ld);
} catch (LDAPException e) {
System.out.println("i=" + i);
int errCode = e.getLDAPResultCode();
System.out.println(errCode + " (" + e + ")");
}
}