It's extremely unlikely that the GC will ever even see that connection
-- because the pool is still aware of it (it knows you checked it
out), so it probably will never be collected. It's way better for you
to make sure you close your result sets, statements and connections in
a finally block. Calling close() is how pools know you're done with
the connection.
DBCP (and other pools) have support for finding connections that have
been checked out of the pool but never returned, but you should never
rely on this for "normal" use.
If you don't/can't make sure to close those connections, consider
using a framework like iBatis or Spring JDBC Template, which take care
of all that stuff for you. They are not as heavy as Hibernate, and
take care of just the annoying details like making sure you close
connections.
-nate
"The sky calls to us. If we do not destroy ourselves, we will one day
venture to the stars." -- Carl Sagan
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To post to this group, send email to
h2-da...@googlegroups.com.
> To unsubscribe from this group, send email to
>
h2-database...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/h2-database?hl=en.
>