Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 56B88D0EF for ; Thu, 29 Nov 2012 09:19:02 +0000 (UTC) Received: (qmail 47459 invoked by uid 500); 29 Nov 2012 09:19:02 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 47277 invoked by uid 500); 29 Nov 2012 09:19:01 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 47204 invoked by uid 99); 29 Nov 2012 09:18:58 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2012 09:18:58 +0000 Date: Thu, 29 Nov 2012 09:18:58 +0000 (UTC) From: "Hendy Irawan (JIRA)" To: dev@directory.apache.org Message-ID: <493940469.39148.1354180738889.JavaMail.jiratomcat@arcas> In-Reply-To: <972258993.121122.1353015312396.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (DIRAPI-96) Connection leak in LdapConnectionPool. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DIRAPI-96?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13506= 350#comment-13506350 ]=20 Hendy Irawan commented on DIRAPI-96: ------------------------------------ Since it wasn't fixed in M13, this bug should be marked as: Affects Version: M13 Fix Version: M14 =20 > Connection leak in LdapConnectionPool. > -------------------------------------- > > Key: DIRAPI-96 > URL: https://issues.apache.org/jira/browse/DIRAPI-96 > Project: Directory Client API > Issue Type: Bug > Reporter: Damien Dub=C3=A9 > Fix For: 1.0.0-M13 > > > If a Connection fails on credentials, the LdapConnection is not closed an= d is not in the pool.=20 > I modified the makeObject() function in PoolableLdapConnectionFactory.jav= a to this and it does the trick. > public Object makeObject() throws Exception > { > LOG.debug("creating a LDAP connection"); > LdapNetworkConnection connection =3D new LdapNetworkConnection(co= nfig); > try { > connection.bind(config.getName(), config.getCredentials()); > } catch (Exception e1) { > try { > connection.close(); > } catch (Exception e2) { > } > throw e1; > } > return connection; > } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira