From user-return-21420-apmail-commons-user-archive=commons.apache.org@commons.apache.org Tue Jul 01 13:07:33 2008 Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 35977 invoked from network); 1 Jul 2008 13:07:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jul 2008 13:07:32 -0000 Received: (qmail 62790 invoked by uid 500); 1 Jul 2008 13:07:29 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 62714 invoked by uid 500); 1 Jul 2008 13:07:29 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 62703 invoked by uid 99); 1 Jul 2008 13:07:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jul 2008 06:07:29 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [194.152.182.1] (HELO mgate.ops.co.at) (194.152.182.1) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jul 2008 13:06:39 +0000 Received: from smtp.ops.co.at (smtp.int.ops.co.at [172.27.0.4]) by mgate.ops.co.at (OPS Mail Gateway - authorized use only - NO UCE/UBE C=AT L=VIE) with ESMTP id CA44EAFE52 for ; Tue, 1 Jul 2008 15:06:28 +0200 (CEST) Received: by smtp.ops.co.at (Postfix, from userid 65534) id C70716E023F; Tue, 1 Jul 2008 15:06:27 +0200 (CEST) Received: from [172.27.1.104] (lints2.int.ops.co.at [172.27.1.104]) by smtp.ops.co.at (Postfix) with ESMTP id 5EEB86E0234 for ; Tue, 1 Jul 2008 15:06:27 +0200 (CEST) Message-ID: <486A2BD4.5080205@chello.at> Date: Tue, 01 Jul 2008 15:06:28 +0200 From: "simon.kitching@chello.at" User-Agent: Thunderbird 2.0.0.12 (X11/20071114) MIME-Version: 1.0 To: Commons Users List Subject: Re: [dbcp] Contention for DriverManager when initializing multiple datasources WAS: Re: dbcp blocked on webapp startup References: <4863AEFE.9030701@last.fm> <48666E2E.8020601@gmail.com> <486A05CD.6010804@last.fm> <486A1214.4080608@chello.at> <486A2978.8010702@last.fm> In-Reply-To: <486A2978.8010702@last.fm> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on smtp.ops.co.at X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, hits=-4.1 required=7.0 tests=AWL,BAYES_00,RATWR10_MESSID, SARE_TOCC_USER,SPG_MG_XXXMD2 autolearn=no version=2.64 Adrian Woodhead schrieb: > Simon - thanks for your feedback, what you said makes sense... >>> The big question is: why are you running dbcp concurrently in two >>> different >>> threads? >>> >> >> Two data sources within the same webapp (spring config) perhaps? >> > Exactly. There are 3 actually - 2 postgres databases and one mysql > database, each has its own pooled datasource. But if all the pools are initialised via Spring, and are all non-lazy then they should be initialised sequentially by the same spring initialisation thread, not in parallel. Spring initialisation is done via a servlet ContextListener, and that is guaranteed to be called single-threaded. But in the thread-dumps, we clearly see two threads doing driver loading in parallel. Presumably some of these pooled datasources are not spring-managed? > >>> Possibly dbcp should call DriverManager.getDrivers() internally on >>> startup >>> to avoid this race... >>> >> >> If this would solve it, I'd say it's a must, then. This is a really >> nasty race condition. >> > It is. Should I file a bug? I'd be happy to try out a build with this > fix in it to see if it helps. Yes, I would suggest filing a bugreport. Cheers, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org