commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: [DBCP] Too many connections issue...
Date Sun, 23 Jan 2011 16:48:26 GMT
On Sun, Jan 23, 2011 at 4:02 AM, Suny kk <suny.kk@gmail.com> 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 <phil.steitz@gmail.com> wrote:
>
>> On Thu, Jan 20, 2011 at 6:16 AM, Suny kk <suny.kk@gmail.com> 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


Mime
View raw message