[ 
https://issues.apache.org/jira/browse/DBCP-212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488252
 ] 

Phil Steitz commented on DBCP-212:
----------------------------------

Thanks, Marcos.  Really appreciate your feedback and help chasing this down.  I 
should have thought a little more about what is going on here before 
responding.  What I now think is happening is that either as a result of 
contention for locks on the pool (via getMaxActive) or buffer flushing in 
System.out, the active threads are periodically closing connections faster than 
they are (collectively) opening them.  This makes the number of idle 
connections periodically exceed maxIdle, they get closed and then load 
increases again, so new ones get created. This could happen in production for 
lots of different reasons.   

I am leaving this open as a dbcp bug, since until pool is improved somehow to 
be more intelligent about destroying idle objects, dbcp is prone to this 
behavior.  The workaround in situations where load and open/close rates can 
flucutate is to set maxIdle = maxActive, or at least to avoid maxIdle << 
maxActive.  

The documentation of both pool and dbcp should be improved to call out the fact 
that the default value of maxIdle is 8 and what this setting really means.

I am also marking this as related to DBCP-205 (maybe a duplicate?).  The same 
Windows socket error was reported there, in that case also associated with 
connection churn, and the resolution of that issue requires the same kind of 
enhancement to pool.

> PoolingDataSource closes physical connections
> ---------------------------------------------
>
>                 Key: DBCP-212
>                 URL: https://issues.apache.org/jira/browse/DBCP-212
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>         Environment: Windows XP, Java 1.5.0_06-b05, Sybase ASE 12.5.4, 
> jConnect 6.0.5 EBF 13862, Commons Pool 1.3
>            Reporter: Marcos Sanz
>         Attachments: DBCPtester.java, DBCPtester.java, output.txt
>
>
> By executing the attached program and monitoring the process id of the 
> physical connections at the database server, it is possible to demonstrate 
> that the connections are being actually physically closed and reopened by the 
> application at a very high rate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to