On Fri, 2003-01-31 at 12:20, Craig R. McClanahan wrote:

IS IT ESSENTIAL TO DO THIS IN A TRY CLAUSE?  MUCH OF OUR CLOSING ISN'T
AND THAT EXCEPTION ISN'T REARING IT'S UGLY HEAD.  IF AN EXCEPTION WERE
THROWN IN A FINALLY CLAUSE, WOULD WE SEE IT ANYWAY?  STUPID QUESTION (I
WOULD THINK YES BUT IF NOT MAYBE WE ARE LEEKING CONNECTIONS THERE??
MAYBE I JUST WILL DO IT LIKE THAT SINCE BEST PRACTICES ARE JUST THAT.
finally {
>     if (rs != null) {
>       try {
>         rs.close();
>       } catch (SQLException e) {
>         ;
>       }
>       rs = null;
>     }
> 
> 

> >
> > 1) must a local ResultSet be explicitely closed to avoid a leak
> 
> Some JDBC drivers will close the ResultSet for you if you close the
> associated Statement, but it sounds like you're probably not doing that
> either.

In most places yes.  Might drivers also close the ResultSet when using a
preparedStatement.

The ps  and connection is always closed.  The ResultSet is closed in
most places (and I'll correct where it's not).

I wonder if the Oracle driver wasn't closing it (not that it should be
expected to) and GC wasn't doing it either, hence the leak.
Anyway, thanks for the help.

Will clean up the few rough spots. 

(if you're old
> enough to remember):  "we have met the enemy and they is us".  :-)
> 
> I remember and will try to keep it more in mind.


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

Reply via email to