directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damien Dubé <damien.d...@gmail.com>
Subject bug in LdapConnectionPool.
Date Thu, 15 Nov 2012 20:57:04 GMT
I found a bug in LdapConnectionPool.

If a Connection fails on credentials, the LdapConnection is not closed and
is not in the pool.

I modified the makeObject() function
in PoolableLdapConnectionFactory.java to this

    public Object makeObject() throws Exception
    {
        LOG.debug("creating a LDAP connection");

        LdapNetworkConnection connection = new
LdapNetworkConnection(config);
        try {
            connection.bind(config.getName(), config.getCredentials());
        } catch (Exception e1) {
            try {
                connection.close();
            } catch (Exception e2) {

            }
            throw e1;
        }
        return connection;
    }

It seems to be doing the trick!


Damien Dubé
damien.dube@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message