Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 84832 invoked from network); 29 Apr 2007 12:04:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Apr 2007 12:04:43 -0000 Received: (qmail 23492 invoked by uid 500); 29 Apr 2007 12:04:43 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 23443 invoked by uid 500); 29 Apr 2007 12:04:43 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 23420 invoked by uid 99); 29 Apr 2007 12:04:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Apr 2007 05:04:43 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Apr 2007 05:04:35 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 792D771406D for ; Sun, 29 Apr 2007 05:04:15 -0700 (PDT) Message-ID: <26692869.1177848255493.JavaMail.jira@brutus> Date: Sun, 29 Apr 2007 05:04:15 -0700 (PDT) From: "kylin (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Commented: (CHAIN-37) The problem of org.apache.commons.chain.impl.ChainBase.execute In-Reply-To: <11892088.1177813395467.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CHAIN-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492567 ] kylin commented on CHAIN-37: ---------------------------- OK,but I don't think so,if you just for singleton pattern, then take this problem , I think use singleton pattern is unseemliness,I believe other users have same problem. > The problem of org.apache.commons.chain.impl.ChainBase.execute > -------------------------------------------------------------- > > Key: CHAIN-37 > URL: https://issues.apache.org/jira/browse/CHAIN-37 > Project: Commons Chain > Issue Type: Bug > Affects Versions: 1.0, 1.1 > Reporter: kylin > Priority: Critical > > The ChainBase.execute metod is not thread safety,I Change the code like that: > // Execute the commands in this list until one returns true > // or throws an exception > boolean saveResult = false; > Exception saveException = null; > int i = 0; > int n = commands.length; > for (i = 0; i < n; i++) { > try { > > Command command = (Command)commands[i]; > > Command newCommand = ((Command)commands[i].getClass().newInstance()); > > PropertyUtils.copyProperties(newCommand,command); > > saveResult = newCommand.execute(context); > > if (saveResult) { > break; > } > } catch (Exception e) { > saveException = e; > break; > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org