You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Bernard Maassen <Be...@cameramanager.com> on 2011/04/07 16:49:33 UTC

[pool]

I've run into a strange problem.
When I initiate my database connections I see the following behavior:

1st connection from the pool is created instantly
all other connections are created really slowly, it seems every 5 second 1 new connection gets connected.
When all connections are connected to the db, everything works like it should.

The waiting connection requests all are in the same state:
java.lang.Thread.State: TIMED_WAITING (on object monitor)
                at java.lang.Object.wait(Native Method)
                at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1123)
                - locked <0x0000000741c54170> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
                at org.apache.commons.dbcp.PoolingDriver.connect(PoolingDriver.java:180)
                at java.sql.DriverManager.getConnection(DriverManager.java:582)
                at java.sql.DriverManager.getConnection(DriverManager.java:207)

It seems like one gets revived every 5 sec, and then connects to the db.

My question is if it is possible to change this internal wait of 5 sec?

Bernard

Re: [pool]

Posted by Phil Steitz <ph...@gmail.com>.
On 4/7/11 7:49 AM, Bernard Maassen wrote:
> I've run into a strange problem.
> When I initiate my database connections I see the following behavior:
>
> 1st connection from the pool is created instantly
> all other connections are created really slowly, it seems every 5 second 1 new connection gets connected.
> When all connections are connected to the db, everything works like it should.
>
> The waiting connection requests all are in the same state:
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
>                 at java.lang.Object.wait(Native Method)
>                 at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1123)
>                 - locked <0x0000000741c54170> (a org.apache.commons.pool.impl.GenericObjectPool$Latch)
>                 at org.apache.commons.dbcp.PoolingDriver.connect(PoolingDriver.java:180)
>                 at java.sql.DriverManager.getConnection(DriverManager.java:582)
>                 at java.sql.DriverManager.getConnection(DriverManager.java:207)
>
> It seems like one gets revived every 5 sec, and then connects to the db.
>
> My question is if it is possible to change this internal wait of 5 sec?
>
> Bernard
>
What versions of [pool] and [dbcp] are you running?

What are the pool configuration parameters?

Phil



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org