Sun LDAP provider sucks
So, we need to do LDAP queries, and when we do them, we need tell LDAP not to dereference objects, else the performance is terrible.
Fortunately, LdapContext.search() takes a SearchControls object which has a get/setDeRefFlag(boolean) method on it. So I just set that to be false, yes?
Oh no, that would be too easy. It turns out, after a good 8 hours of ethereal tracing and class decompiling (sun don't supply source for the com.sun.jndi.ldap classes, bless 'em) that the SearchControls setting is completely ignored, in favour of an environment setting (undocumented, of course) that you have to pass in to LdapContext:
env.put("java.naming.ldap.derefAliases", "never");
ho hum…
Chris May
Loading…
Add a comment
You are not allowed to comment on this entry as it has restricted commenting permissions.