On Tue, 27 Aug 2002, Tim Funk wrote:

> Date: Tue, 27 Aug 2002 12:03:18 -0400
> From: Tim Funk <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: Does closing a Connection variable and setting it to null
>     close all of the ResultSet and Statements?
>
> It is not requried to close ResultSets, Statements, etc if you close the
> connection. (I think) The spec says if you close a connection - all
> associated resources for that connection will also be closed.
>

That's what the spec says, but relying on it is being awfully trusting of
JDBC driver developers to do the right thing.  A little paranoia here
(i.e.  close the result sets and statements yourself) goes a long way
towards making your apps more reliable.

Craig


> If you are using a pool - the pool manager *should* be obeying this
> principal too.
>
> Michael Nicholson wrote:
> > Well, I guess the subject line says it all.  I'm having memory issues, and having 
>read the OOM error messages on the list, I've checked and found some open and not 
>being closed connections, so I'm going back and closing them all.  The question is do 
>I need to explicitly close/dereference (set to null) all statements and recordsets 
>too?  Right now the system takes about 4% of my available memory just for the beans 
>in question, so I'm trying to minimize what I store so that I could conceptually have 
>more than one user.
> >
> > Thanks in advance,
> > Mike Nicholson
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


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

Reply via email to