commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alik Eliashberg <>
Subject Resource cleanup in DBCP
Date Mon, 01 Nov 2004 18:58:58 GMT

Does DBCP close the connection related resources (e.g. 
PreparedStatements) on the return to the pool? From a cursory look at 
the source code, it looks like it only closes the connection-related 
resources if the connection is closed and removed from the pool - not 
when the user code just calls Connection.close(), thereby returning the 
connection to the available pool.

If that is by design, then why? It seems that it would place an extra 
onerous on user code to be peppered with 'try/finally' clauses to catch 
all hanging Statements... [The problem is partially solved by using 
DbUtils, which has the 'try/finally' blocks, but why not let DBCP 
cleanup these resources? Is there a meaningful case where the connection 
is returned to the pool, but the Statement should not be closed?]



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message