Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 81178 invoked from network); 25 Jan 2011 21:40:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Jan 2011 21:40:50 -0000 Received: (qmail 81874 invoked by uid 500); 25 Jan 2011 21:40:49 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 81622 invoked by uid 500); 25 Jan 2011 21:40:48 -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 81614 invoked by uid 99); 25 Jan 2011 21:40:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jan 2011 21:40:48 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of minhaj.kk@gmail.com designates 209.85.214.43 as permitted sender) Received: from [209.85.214.43] (HELO mail-bw0-f43.google.com) (209.85.214.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jan 2011 21:40:42 +0000 Received: by bwz14 with SMTP id 14so789847bwz.30 for ; Tue, 25 Jan 2011 13:40:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:content-type; bh=q7bmuZK7XNUDYikkQYiEMAdHdvazcueVTpMOnoSrm/A=; b=JIuHonez4IJ+6OF/1qrgCgMO7sI3UYekfxoLAu+vs6hBH+B0Yl91kHL0I6A/IbCfAk smYTxLcvU1A9+tooWNYTiMNGbE7hGpYuZZC9AaSd6cUR/0rNdd5OTNpmRHM3xPtMb632 Z2fMK03AKRW8C3kHcnCgBQX4S9eWbdaUtxbSQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=RFrL3/VuQnTNuUYRv92RPUKHGtPMIkNuX27iQMpA1RQBeRyxuBZEtJAHPTW3mOOSTl q+RSh7s+9qIrptsdNeDIk6GLsMskA7u/g2xAevc41uqv7Hb1q5ClspOemtsdhi4SJD50 4iW+xT9F1RDFSrIvG+1qnrYQlMOEX2NHp67O4= Received: by 10.204.114.81 with SMTP id d17mr5726056bkq.135.1295991620159; Tue, 25 Jan 2011 13:40:20 -0800 (PST) MIME-Version: 1.0 Sender: minhaj.kk@gmail.com Received: by 10.204.152.211 with HTTP; Tue, 25 Jan 2011 13:39:50 -0800 (PST) In-Reply-To: References: From: Suny kk Date: Wed, 26 Jan 2011 01:39:50 +0400 X-Google-Sender-Auth: 7VbqC70H2Wl6Egm1Aw-2iAfQvnY Message-ID: Subject: Re: [DBCP] Too many connections issue... To: Commons Users List Content-Type: multipart/alternative; boundary=001636c597cf26cab4049ab29083 --001636c597cf26cab4049ab29083 Content-Type: text/plain; charset=UTF-8 Hi Phil, Yes, I'm using BasiDataSource well, Is it because of my DBCP settings? Remember I got this exception when I started my application on different machine with same database. Regards On Sun, Jan 23, 2011 at 8:48 PM, Phil Steitz wrote: > On Sun, Jan 23, 2011 at 4:02 AM, Suny kk wrote: > > I'm using DBCP 1.2.2 version there's no commons pool dependency in my > > project and following is stack trace > > > > org.springframework.jdbc.UncategorizedSQLException : (Hibernate > operation): > >> encountered SQLException [Cannot create PoolableConnectionFactory (Data > >> source rejected establishment of connection, message from server: "Too > many > >> connections")]; nested exception is > >> org.apache.commons.dbcp.SQLNestedException: Cannot create > >> PoolableConnectionFactory (Data source rejected establishment of > connection, > >> message from server: "Too many connections") > >> > > The server is rejecting DBCP's initial attempt at connecting. The > message, which is coming from the jdbc driver, appears to indicate > that the server is out of connections when DBCP is trying to start. > The stack trace indicates that this is happening on the first call to > getConnection() (assuming you are using BasicDataSource). > > Phil > > > > > > On Thu, Jan 20, 2011 at 4:02 PM, Phil Steitz > wrote: > > > >> On Thu, Jan 20, 2011 at 6:16 AM, Suny kk wrote: > >> > Hi, > >> > > >> > > >> > I've facing "Too many connections" issue and following are my DBCP > >> > settings... > >> > >> What exactly is your problem - i.e., what exception / liveness issue > >> are you seeing. Also what versions of commons dbcp and commons pool > >> are you running? > >> > >> Phil > >> > > >> > ##################################### > >> > # DBCP Connection Pool Settings > >> > ##################################### > >> > > >> > # The connection properties that will be sent to our JDBC driver when > >> > # establishing new connections. > >> > dbcp.connectionProperties="" > >> > > >> > # The default auto-commit state of connections created by this pool. > >> > # [Default: true] > >> > dbcp.defaultAutoCommit=true > >> > > >> > # The default read-only state of connections created by this pool. If > not > >> > set > >> > # then the setReadOnly method will not be called. > >> > #dbcp.defaultReadOnly= > >> > > >> > # The default catalog of connections created by this pool. > >> > #dbcp.defaultCatalog= > >> > > >> > # The initial number of connections that are created when the pool is > >> > started. > >> > # [Default: 0] > >> > dbcp.initialSize=10 > >> > > >> > # The maximum number of active connections that can be allocated > >> > # from this pool at the same time, or negative for no limit. [Default: > 8] > >> > dbcp.maxActive=500 > >> > > >> > # The maximum number of connections that can remain idle in the pool, > >> > # without extra ones being released, or negative for no limit. > [Default: > >> 8] > >> > dbcp.maxIdle=8 > >> > > >> > # The minimum number of connections that can remain idle in the pool, > >> > without > >> > # extra ones being created, or zero to create none. [Default: 0] > >> > dbcp.minIdle=0 > >> > > >> > # The maximum number of milliseconds that the pool will wait (when > there > >> are > >> > # no available connections) for a connection to be returned before > >> throwing > >> > an > >> > # exception, or -1 to wait indefinitely. [Default: -1] > >> > dbcp.maxWait=30000 > >> > > >> > # The SQL query that will be used to validate connections from this > pool > >> > before > >> > # returning them to the caller. If specified, this query MUST be an > SQL > >> > SELECT > >> > # statement that returns at least one row. > >> > dbcp.validationQuery=SELECT 1 > >> > > >> > # The indication of whether objects will be validated before being > >> borrowed > >> > # from the pool. If the object fails to validate, it will be dropped > from > >> > the > >> > # pool, and we will attempt to borrow another. [Default: true] > >> > # > >> > # NOTE - for a true value to have any effect, the validationQuery > >> parameter > >> > # must be set to a non-null string. > >> > dbcp.testOnBorrow=true > >> > > >> > # The indication of whether objects will be validated before being > >> returned > >> > to > >> > # the pool. [Default: false] > >> > # > >> > # NOTE - for a true value to have any effect, the validationQuery > >> parameter > >> > # must be set to a non-null string. > >> > dbcp.testOnReturn=false > >> > > >> > # The indication of whether objects will be validated by the idle > object > >> > # evictor (if any). If an object fails to validate, it will be dropped > >> from > >> > the > >> > # pool. [Default: false] > >> > # > >> > # NOTE - for a true value to have any effect, the validationQuery > >> parameter > >> > # must be set to a non-null string. > >> > dbcp.testWhileIdle=false > >> > > >> > # The number of milliseconds to sleep between runs of the idle object > >> > evictor > >> > # thread. When non-positive, no idle object evictor thread will be > run. > >> > # [Default: -1] > >> > dbcp.timeBetweenEvictionRunsMillis=-1 > >> > > >> > # The number of objects to examine during each run of the idle object > >> > evictor > >> > # thread (if any). [Default: 3] > >> > dbcp.numTestsPerEvictionRun=3 > >> > > >> > # The minimum amount of time an object may sit idle in the pool before > it > >> is > >> > # eligable for eviction by the idle object evictor (if any). > >> > # [Default: 180000 (30 min)] > >> > dbcp.minEvictableIdleTimeMillis=180000 > >> > > >> > # A Collection of SQL statements that will be used to initialize > physical > >> > # connections when they are first created. These statements are > executed > >> > # only once - when the configured connection factory creates the > >> connection. > >> > # [Default: null] > >> > #dbcp.connectionInitSqls= > >> > > >> > # Enable prepared statement pooling for this pool. [Default: false] > >> > dbcp.poolPreparedStatements=true > >> > > >> > # The maximum number of open statements that can be allocated from the > >> > # statement pool at the same time, or zero for no limit. [Default: 0] > >> > dbcp.maxOpenPreparedStatements=25 > >> > > >> > # Controls if the PoolGuard allows access to the underlying > connection. > >> > # [Default: false] > >> > dbcp.accessToUnderlyingConnectionAllowed=false > >> > > >> > # Flag to remove abandoned connections if they exceed the > >> > # removeAbandonedTimout. If set to true a connection is considered > >> abandoned > >> > # and eligible for removal if it has been idle longer than the > >> > # removeAbandonedTimeout. Setting this to true can recover db > connections > >> > from > >> > # poorly written applications which fail to close a connection. > >> > # [Default: false] > >> > dbcp.removeAbandoned=false > >> > > >> > # Timeout in seconds before an abandoned connection can be removed. > >> > # [Default: 300] > >> > dbcp.removeAbandonedTimeout=300 > >> > > >> > # Flag to log stack traces for application code which abandoned a > >> Statement > >> > or > >> > # Connection. Logging of abandoned Statements and Connections adds > >> overhead > >> > for > >> > # every Connection open or new Statement because a stack trace has to > be > >> > # generated. [Default: false] > >> > dbcp.logAbandoned=false > >> > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > >> For additional commands, e-mail: user-help@commons.apache.org > >> > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --001636c597cf26cab4049ab29083--