On 4/3/07, Filip Hanik - Dev Lists <[EMAIL PROTECTED]> wrote:
Would you guys be open to a patch to implement a periodic cleanup of abandoned connections the following logic can cause abandoned connections to sit around forever, just because you are not hitting the max in the pool. Using a DB like postgres that creates a process for each connection, this is a waste of resources, and the only way to trigger the abandoned cleanup is to try to get to max number of connections.if (config != null && config.getRemoveAbandoned() && (getNumIdle() < 2) && (getNumActive() > getMaxActive() - 3) ) { removeAbandoned(); } Let me know, and if yes, I will provide a patch
I agree that the above setup is not optimal. Now is a good time to talk about what we want to do in this area. The abandoned connection cleanup problem has sort of a rich history in [dbcp] and is a complex problem. See for example: http://marc.info/?t=105633413400001&r=1&w=4 (Start with David Graham's first post on 24-Jun-2003) My own opinion on needing to provide *something* here has not changed -- I think we should provide a well-designed and safe capability to remove abandoned connections - but wrestling with concurrency bugs (e.g., the still-open DBCP-44) has made me appreciate how hard this is. Note that the AbandonedConfig and AbandonedObjectPool that provide the functionality above have been deprecated and we should be thinking about how to replace / remove them (so I don't think patching AbandonedObjectPool is the best idea), so now is a good time to open the discussion on how to provide a better solution. Ideas / suggestions welcome! Phil --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
