Pooling LDAP connections doesn't work with custom socket factory

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 5.0-pool, 6-pool, 7-pool, 8-pool, 9
    • Component/s: core-libs
    • None

      According to [1] LDAP connections can be pooled even if used with custom socket factories. Unfortunately it's not the way it works. As can be seen from [2] classnames of the factories are being passed to a comparator rather than factories themselves. That leads to a situation when at a runtime ClassCastException is silently swallowed and 'false' from the comparison is returned. And a custom compare() method is never executed. Thus connections are always treated as different and therefore never pooled.

      -------------------------------------------------
      [1] http://docs.oracle.com/javase/6/docs/technotes/guides/jndi/jndi-ldap.html#pooling
      [2] http://hg.openjdk.java.net/jdk6/jdk6/jdk/file/619655c4e72d/src/share/classes/com/sun/jndi/ldap/ClientId.java#l191

            Assignee:
            Aleksej Efimov
            Reporter:
            Pavel Rappo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: