Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D345D200C15 for ; Wed, 25 Jan 2017 01:30:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D2177160B4B; Wed, 25 Jan 2017 00:30:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2716C160B3E for ; Wed, 25 Jan 2017 01:30:14 +0100 (CET) Received: (qmail 53245 invoked by uid 500); 25 Jan 2017 00:30:13 -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 53231 invoked by uid 99); 25 Jan 2017 00:30:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jan 2017 00:30:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 190021A02A1 for ; Wed, 25 Jan 2017 00:30:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.1 X-Spam-Level: X-Spam-Status: No, score=-3.1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-2.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=elyograg.org Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id lQsqEbCbnGJ8 for ; Wed, 25 Jan 2017 00:30:06 +0000 (UTC) Received: from frodo.elyograg.org (frodo.elyograg.org [166.70.79.219]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id EBAC25F296 for ; Wed, 25 Jan 2017 00:30:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by frodo.elyograg.org (Postfix) with ESMTP id 7E6E01D35 for ; Tue, 24 Jan 2017 17:29:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=elyograg.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :mime-version:user-agent:date:date:message-id:from:from :references:subject:subject:received:received; s=mail; t= 1485304181; bh=vad3N/inI9zmZ3U/p/52m/BeZEV2G9nvHSNghhC5bzI=; b=f 97U7F0tRNL/IOHyQ+KG/tEL89+6wDB7gPHrJGCcWS3+IlGMthvXhZZ++CxTlcZIX oQG2akwMkv8b8QiNYEesUuBBe8kQijPlSK3sr0kBXbvgtNZo/WPmW5zPJy2jD3Pm 9/fIxmzVWgaSXiPQD7uWMRX00vdqI7uDaPf6UFgJb0= X-Virus-Scanned: Debian amavisd-new at frodo.elyograg.org Received: from frodo.elyograg.org ([127.0.0.1]) by localhost (frodo.elyograg.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hKA9Ghb-ix49 for ; Tue, 24 Jan 2017 17:29:41 -0700 (MST) Received: from [10.2.0.108] (client175.mainstreamdata.com [209.63.42.175]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: elyograg@elyograg.org) by frodo.elyograg.org (Postfix) with ESMTPSA id 893FF1CDE for ; Tue, 24 Jan 2017 17:29:40 -0700 (MST) Subject: Re: [EXTERNAL]Re: DBCP issuing more sessions than maxActive sessions in Oracle To: Commons Users List References: <15244fb6-409a-e51d-471d-b2037cc93b65@gmail.com> From: Shawn Heisey Message-ID: Date: Tue, 24 Jan 2017 17:29:34 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit archived-at: Wed, 25 Jan 2017 00:30:15 -0000 On 1/24/2017 3:55 PM, Romero, René wrote: > We're running commons-dbcp-1.4 and commons-pool-1.6. To me, it sounds like we're being impacted by this bug: > > https://issues.apache.org/jira/browse/DBCP-379 > > [DBCP-379] number of connections created has crossed more ... > issues.apache.org > I found that when the minIdle is configured then during loads, common pool creates more number of connections it will be greater than maxActive. > > Is it transparent application-wise to jump from these versions to the latests? Or what upgrading path do you suggest we take? I don't know anything about that bug or whether that is what you are encountering, but I can discuss upgrading. You seem to be on the latest 1.x versions. Upgrading to the 2.x versions will require code changes, because the package names have changed. A few other things have changed as well. When I did the upgrade, I found it to be pretty easy to make the conversion. Changing the imports was a big part of the job, which my IDE (eclipse) basically did for me. A few changes were also required when building the datasource objects. Here's a slightly redacted patch that shows the code changes I made when I upgraded POOL and DBCP from 1.x to 2.x: https://www.dropbox.com/s/de1hpa767i8tg5s/dbcp2-upgrade.patch?dl=0 This upgrade was done nearly two years ago, but I think I remember enough about it that I may be able to answer questions on the patch. The code went through a whole bunch of changes after the upgrade. I changed "replica" to "main" throughout the class. The "replica database server" section that you can see in the patch now looks like the following: /* * Create a datasource (connection pool) for the main database server. */ ConnectionFactory cfMain = new DriverManagerConnectionFactory(mainUrl, dbUser, dbPass); PoolableConnectionFactory pcfMain = new PoolableConnectionFactory(cfMain, null); pcfMain.setValidationQuery(validationQuery); pcfMain.setValidationQueryTimeout(Const.FIVE_SECONDS / 1000); opMain = new GenericObjectPool<>(pcfMain); opMain.setMaxWaitMillis(Const.THIRTY_SECONDS); opMain.setMaxIdle(numShards); opMain.setMaxTotal(numShards * 5); opMain.setNumTestsPerEvictionRun(numShards * 5); opMain.setTimeBetweenEvictionRunsMillis(Const.ONE_MINUTE); opMain.setMinEvictableIdleTimeMillis(Const.ONE_MINUTE * 5); pcfMain.setPool(opMain); dsMain = new PoolingDataSource<>(opMain); Thanks, Shawn --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org