It depends. If your webapp calls connection.close(), then the result sets *should* be closed.

But that is based one of the following assumptions:
- Your connection is the actual db connection and the driver is JDBC compliant
- The connection is a facade to the actual connection for the sake of using a database connection pool. And the facade is smart enough to close all dependent assets on that connection for you.


I *try* to make my programmers only have one statement and result set open at a time per connection. If a second statement or result set needs opened, they should either close the existing resources or open another connection. They must always close ANYTHING they open.

-Tim

John Turner wrote:

Tim Funk wrote:

The JDBC spec states that when a connection is closed, all dependent assets should also be closed. So if you are using a pool, make sure your pool is compliant since the connection is never closed until the pool closes it.


So, that means that if you have a pool of ten connections, and you use each of those ten connections ten times with 2 ResultSets, you have 200 ResultSets sitting in memory, assuming you don't close them yourself?

John



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



Reply via email to