(In reply to comment #1)
> The JDBC Spec says indeed that those resources will be automatically closed
> when garbag collected. It doesn't say when they can be garbage collected,
> does it place restrictions on implementations to garbage collect after
> executing SQL. So DBCP is not in violation of the Spec by a long shot.
It also says
"A ResultSet object is automatically closed when the Statement object that
generated it is closed, re-executed, or used to retrieve the next result from a
sequence of multiple results."
and close says
"Releases this ResultSet object's database and JDBC resources immediately
instead of waiting for this to happen when it is automatically closed."
Which is pretty clear that they should be release immediately - which DBCP
> Accordingly, I'm changing this into an enhancement request. If you want to
> increase the probability of it being done any time soon, submit a patch.
I think you might have been a little hasty here - for the reason above.
> item will become moot. Second, the best practice for JDBC resource handling
> to explicitly close what you don't need. People who write code as you
> illustrate above are not following that practice and don't deserve much
No argument here, except that "naive" users will use DBCP and NOT get the
behaviour they expect !!