Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
1.2.2
-
None
-
None
-
commons-dbcp-1.2.1.jar
Description
hi,
the SharedPoolDataSource class uses the class GenericKeyedObjectPool which has a FIFO behavior.
the problem is that when all connections in the pool are used, the synchronised method SharedPoolDataSource.getPooledConnectionAndInfo
calls the borrowObject() blocking method and does not release its monitor.
as a result, all other threads asking for a connection get blocked trying to get the monitor
and will get a connection later in a non-FIFO mode.
i think the fix is to synchronized only the code block :
if (pool == null) {
try
catch (NamingException e)
{ throw new SQLNestedException("RegisterPool failed", e); } }
instead of synchronizing the whole method.
thanks
rodolphe