Re: jdbc pooling question - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: jdbc pooling question
Date
Msg-id Pine.LNX.4.33.0401111705510.5953-100000@leary.csoft.net
Whole thread Raw
In response to jdbc pooling question  ("Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br>)
Responses Re: jdbc pooling question  (Paul Thomas <paul@tmsl.demon.co.uk>)
List pgsql-jdbc

On Sun, 11 Jan 2004, Marcus Andree S. Magalhaes wrote:

>
> Hi, guys.
>
> We're suffering (probably) a connection leak problem while
> using Jdbc2PoolingDataSource that comes with jdbc drivers
> for postgres 7.3.
>
> Recently, a freeze problem was detected and the debugging
> showed that we may have some leaks.
>
> Before digging deeply into the driver's source code, we decided
> to analyze our own java sources and found a couple places where
> the statements and the connections were closed, but not the
> resultset.
>
> The question is, in this configuration (connection & statement closed),
> there is any possibility of the connection isn't being properly closed
> by the pool and, therefore, being leaked?

Closing the connection will return the connection to the pool regardless
of the status of other related objects.  The fact that closing the
statement and the connection doesn't completely close the ResultSet is a
bug, but not a terribly serious one.  Adding a check for every single
method to check some kind of isClosed flag is tedious and wasteful.

Kris Jurka


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Connection Pool Timeout
Next
From: Oliver Jowett
Date:
Subject: Re: PreparedStatement parameters and mutable objects