Connections can also be orphaned (abandoned) by unexpected errors in the application. What do people think about possibly moving the code that reclaims abandoned connections to a separate thread, similar to idle object eviction? The current rules for when an abandoned connection gets reclaimed by the abandoned object pool are a little kludgey, in that they depend upon a connection being requested when the pool is within 2 connections of being exhausted. If you have a situation where connections are not requested with great frequency, it is possible to acquire a number of rather old abandoned connections that are not reclaimed. If you have issues like firewall or database timeouts closing the connections, they can also be invalid when returned to the pool and will remain available to the application until the idle object eviction thread subsequently runs.

Kris

Mario Ivankovits wrote:

"There are several circumstances where two different pieces of code can be
inadvertently sharing the same connection ... ."
Is it possible in DBCP ? I believe it will not return the same connection
instance for different threads and will not return
connection to pool before close. Is it used store connections in fields ?



If you configure "abandoned" connections, it is possible, if an application do not pass the connection back within an defined idle-time, that the connection is passed back to the pool automatically, while the application still have the reference to the connection.

I have to convert our application from "single connection" to "connection
pooling", while for 90% of the code it is easy possible, if think (know)
that there will be "connection leaks" (connections not passed back) within
our application for the first few weeks. Therefore i have to use the
abandoned-configuration.

However, i any case an "abandoned" connection should not be valid to the
application.


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





-- ===================================================== Kris Nuttycombe Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6337 [EMAIL PROTECTED] =====================================================







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



Reply via email to