Hi,
agree with Mark.
If you did not setup maxActive, default value is 8, see
http://commons.apache.org/dbcp/configuration.html
you can set it to -1, but I strongly discourage this because you will
not see connection leak and you will damage both java server and database.
you should consider:
- doing a thread dump (use sudo kill -3 on Linux or Ctrl+Break on Windows)
- use netstat -ap | grep ... to check number of established cnx and who
is using them
- setting maxWait to 1000 for example so you get an exception after 1000
ms if the pool is exhausted. For it will help for debug purpose at least
to check weither you have contention (you will get few exceptions) or
deadlock (you will get non stopping exceptions)
Note that there is a contention issue on previous pool implementation.
Cyrille
Mark Thomas wrote:
On 19/12/2009 00:02, Pawan Singh wrote:
I am getting a deadlock in the following place very occasionally. My code is
set up exactly as the examples suggest on the DBCP site.
The code seems to be deadlocked at:
GenericObjectPool.borrowObject() line:1104 <--- this code is in
WHEN_EXHAUSTED_BLOCK and is waiting on latch.wait().
PoolingDataSource.getConnection() line: 96
My set up does not initialize the max or min connections at all with the
understanding that the pool will allocate new connections as needed. Is the
deadlock caused by the fact that someone did not return the connection to
the pool and there is a max limit on it? How do I find how many connections
are in the pool and who is using them?
One last piece of information - I am using DBCP and Pool in a J2SE app.
Do you mean deadlocked or blocked. There is a difference. A thread dump
would help considerably here.
What versions are dbcp and pool are you using?
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]