commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject DBCP Locking Up?
Date Tue, 04 Dec 2007 16:17:22 GMT
We are using DBCP with iBatis in a JSF/Ajax webapp running in Tomcat with an Oracle database.

The application has quite high load and concrrency, and the database is very loaded. The application
is running fine for some days but then freezes at peak hours.

When I look at a thread dump made while the app hangs, I can see as many threads as we have
connections in the pool (64) in BLOCKED state while calling either borrowObject() or returnObject(),
please see the two examples below. It looks like some kind of deadlock and the only way out
of it seems to be a restart of Tomcat.

First I thought this is normal with the WHEN_EXHAUSTED_LOCK action, but since we have maxWait
set to 1000 I'd not expect this kind of blocking to happen.

I tried to reproduce the behavior with a small test app, but here the threads go in TIMED_WAIT
state when the pool is exhausted and become RUNNABLE again as soon as some connection became
available again.

I really don't understand what is happening and why the pool gets locked up that way.

Any hint/suggestion welcome!


"TP-Processor483" daemon prio=10 tid=0x01fe5000 nid=0x11f7 waiting for monitor entry [0x8d87e000..0x8d881788]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.apache.commons.pool.impl.GenericObjectPool.returnObject(
	- waiting to lock <0x9ddf7460> (a org.apache.commons.pool.impl.GenericObjectPool)
	at org.apache.commons.dbcp.PoolableConnection.close(
	- locked <0xf83f9eb8> (a org.apache.commons.dbcp.PoolableConnection)
	at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(
	at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.close(
	at com.ibatis.sqlmap.engine.transaction.TransactionManager.end(

"TP-Processor382" daemon prio=10 tid=0x026f6000 nid=0x25a waiting for monitor entry [0x7de7f000..0x7de81808]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(
	- waiting to lock <0x9ddf7460> (a org.apache.commons.pool.impl.GenericObjectPool)
	at org.apache.commons.dbcp.PoolingDataSource.getConnection(
	at org.apache.commons.dbcp.BasicDataSource.getConnection(
	at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(
	at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message