Return-Path: X-Original-To: apmail-jakarta-dev-archive@minotaur.apache.org Delivered-To: apmail-jakarta-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A45FD9AF7 for ; Wed, 19 Oct 2011 11:34:01 +0000 (UTC) Received: (qmail 95213 invoked by uid 500); 19 Oct 2011 11:34:01 -0000 Delivered-To: apmail-jakarta-dev-archive@jakarta.apache.org Received: (qmail 95063 invoked by uid 500); 19 Oct 2011 11:34:00 -0000 Mailing-List: contact dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jakarta.apache.org Delivered-To: mailing list dev@jakarta.apache.org Received: (qmail 95052 invoked by uid 99); 19 Oct 2011 11:34:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2011 11:34:00 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of philippe.mouawad@gmail.com designates 209.85.213.172 as permitted sender) Received: from [209.85.213.172] (HELO mail-yx0-f172.google.com) (209.85.213.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2011 11:33:54 +0000 Received: by yxj19 with SMTP id 19so1926141yxj.31 for ; Wed, 19 Oct 2011 04:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=LJxlGk6SJZxCg/kPq9pAahk6mFMNhz+TCwaZz/+oel4=; b=GHB89vtKoCuaN3otVuq9HOjcltMTZMU+UZ3wzYonS08vY6QxMIkz254aavTjkIRoxo Tbp3GRBE1GNdnuf91xOdomT7YX9fNnWIMfw3PFtPXunrfqzKpaHEB/n2XBLFx+zbXxUV Sd8qHLHYS5eh7o37ZAbBYI/DUWjVtZdARQpR4= MIME-Version: 1.0 Received: by 10.150.67.13 with SMTP id p13mr1707287yba.80.1319024013307; Wed, 19 Oct 2011 04:33:33 -0700 (PDT) Received: by 10.151.102.4 with HTTP; Wed, 19 Oct 2011 04:33:33 -0700 (PDT) In-Reply-To: References: Date: Wed, 19 Oct 2011 13:33:33 +0200 Message-ID: Subject: Issue 52044 From: Philippe Mouawad To: "dev@jakarta.apache.org" Content-Type: multipart/alternative; boundary=000e0cd482bac36da504afa535bf X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd482bac36da504afa535bf Content-Type: text/plain; charset=ISO-8859-1 Hello sebb, Regarding: > I've just realised there is a reason why the Context was being cached. > > The Context holds execution context, so needs to be maintained between > samplers in the same thread. If it was the case then there was an issue in this, because 2 threads could share the same Context in initial implementation. Maybe an issue with perf, I will add thread name to key Regards On Wed, Oct 19, 2011 at 8:02 AM, sebb wrote: > > On 18 October 2011 22:21, sebb wrote: > > On 18 October 2011 19:50, Philippe Mouawad > > wrote: > >> Hello Sebb, Milamber , All, > >> I investigated this issue, particularly this part of issue > >> > >>> stramge error for "JMS Subscriber - 001" - Response message: > >>> javax.naming.NamingException: Something already bound at Elite_To_MorphoTrak; > >> > >> I created a simple test case and tried not to cache Context and it works > >> fine. > >> and in fact it is due to the fact that we cache Context and use it by many > >> threads. > >> From this: > >> http://download.oracle.com/javase/jndi/tutorial/beyond/misc/sync.html > >> > >> I conclude we should not do caching as it is not mandatory that context is > >> Thread Safe (and it's not the case for AMQ one). > >> > >> Do you remember why Context were cached ? was it because of bad performances > >> if not cached ? > > > > I think that was before my time. > > > >> There are 2 solutions for that: > >> > >> - We remove caching > >> - We add an option in GUI to let user select if Context will be cached > >> or not > > > > Or we cache per thread, e.g. using ThreadLocal. > > I've just realised there is a reason why the Context was being cached. > > The Context holds execution context, so needs to be maintained between > samplers in the same thread. > > One easy way to fix the context sharing across threads would be to > include the thread name in the context key. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: dev-help@jakarta.apache.org > -- Cordialement. Philippe Mouawad. --000e0cd482bac36da504afa535bf--