Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 83921 invoked from network); 4 May 2009 14:06:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 May 2009 14:06:05 -0000 Received: (qmail 85679 invoked by uid 500); 4 May 2009 14:06:04 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 85644 invoked by uid 500); 4 May 2009 14:06:04 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 85609 invoked by uid 500); 4 May 2009 14:06:04 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 85592 invoked by uid 99); 4 May 2009 14:06:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 14:06:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 14:06:00 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 198E2234C044 for ; Mon, 4 May 2009 07:05:39 -0700 (PDT) Message-ID: <876855984.1241445939102.JavaMail.jira@brutus> Date: Mon, 4 May 2009 07:05:39 -0700 (PDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Resolved: (CAMEL-1583) ldap component is not thread safe In-Reply-To: <1945756483.1241259698108.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-1583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen resolved CAMEL-1583. -------------------------------- Resolution: Fixed Fix Version/s: 2.0.0 1.6.1 trunk: 771303, 771307. 1.x: 771309. Yeah I needed two commits on trunk as the patch was for 1.x and it used generics in the LdapProducer. So I had to remove it again on trunk :) > ldap component is not thread safe > --------------------------------- > > Key: CAMEL-1583 > URL: https://issues.apache.org/activemq/browse/CAMEL-1583 > Project: Apache Camel > Issue Type: Bug > Components: camel-ldap > Affects Versions: 1.6.0, 2.0-M1 > Environment: N/A > Reporter: Christopher Hunt > Assignee: Claus Ibsen > Fix For: 1.6.1, 2.0.0 > > Attachments: LdapProducer.java.diff > > > JNDI context objects are not thread-safe. The LDAP component shares a directory context across all threads that use the component. This is not safe. > In addition the LDAP component will attempt to establish a connection on instantiation of the component, and not when the component is required to process requests. If the LDAP server is not ready e.g. temporarily unavailable then the entire Camel application will stop. > JNDI directory contexts should be established when a consuming thread needs it and should be released when the thread is finished with the component i.e.: > {code} > ctx = new InitialDirContext(env); > try { > ... > } finally { > ctx.close(); > } > {code} > The above will release the connection with the LDAP server as soon as possible. The existing component relies on JNDI to release the socket in its own time (several seconds later). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.