pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: BUG #2060: Issue with Data base connection
2+ messages / 2 participants
[nested] [flat]
* Re: BUG #2060: Issue with Data base connection
@ 2005-11-23 19:44 Kris Jurka <jurka@ejurka.com>
0 siblings, 1 reply; 2+ messages in thread
From: Kris Jurka @ 2005-11-23 19:44 UTC (permalink / raw)
To: kalisetty manideep <mani7deep@yahoo.com>; +Cc: pgsql-jdbc; pgsql-bugs@postgresql.org
kalisetty manideep wrote:
> [Backend reports "too many open connections"]
>
> But I am 100% sure that its not the issue with the
> code.
>
> Do you know any Postgresql - JDBC driver, which is not
> from Postgresql development group. I think JDBC driver
> is not closing the connection even though I am closing
> the connection.
I have no reason to believe that and you certainly haven't shown that.
> Please refer to the DBACCESS file attached.
>
All this shows is the Connection being opened, not closed.
I've implemented an idea I got from rupa in #postgresql a while ago
about a way of logging leaked connections. I've added some code to the
Connection's finalize() method that prints some logging information if
the Connection was not closed. This is enabled by using the new
logUnclosedConnections URL parameter.
See the attached code for an example. I've put up a new jar that
contains this here: http://www.ejurka.com/pgsql/jars/km
Attachments:
OpenConn.java (text/x-java, 377B) download
import java.sql.*;
public class OpenConn {
public static void main(String args[]) throws Exception {
Class.forName("org.postgresql.Driver");
leakConnection();
System.gc();
}
private static void leakConnection() throws Exception {
Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5810/jurka?logUnclosedConnections=true","jurka","");
}
}
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [JDBC] BUG #2060: Issue with Data base connection
@ 2005-11-23 20:52 Dave Cramer <pg@fastcrypt.com>
parent: Kris Jurka <jurka@ejurka.com>
0 siblings, 0 replies; 2+ messages in thread
From: Dave Cramer @ 2005-11-23 20:52 UTC (permalink / raw)
To: Kris Jurka <jurka@ejurka.com>; +Cc: kalisetty manideep <mani7deep@yahoo.com>; pgsql-jdbc; pgsql-bugs@postgresql.org
It's interesting to note that *everyone* else using the JDBC driver
doesn't have this problem ?
Dave
On 23-Nov-05, at 2:44 PM, Kris Jurka wrote:
> kalisetty manideep wrote:
>> [Backend reports "too many open connections"]
> >
>> But I am 100% sure that its not the issue with the
>> code.
>> Do you know any Postgresql - JDBC driver, which is not
>> from Postgresql development group. I think JDBC driver
>> is not closing the connection even though I am closing
>> the connection.
>
> I have no reason to believe that and you certainly haven't shown that.
>
>> Please refer to the DBACCESS file attached.
>
> All this shows is the Connection being opened, not closed.
>
> I've implemented an idea I got from rupa in #postgresql a while ago
> about a way of logging leaked connections. I've added some code to
> the Connection's finalize() method that prints some logging
> information if the Connection was not closed. This is enabled by
> using the new logUnclosedConnections URL parameter.
>
> See the attached code for an example. I've put up a new jar that
> contains this here: http://www.ejurka.com/pgsql/jars/km
> import java.sql.*;
>
> public class OpenConn {
>
> public static void main(String args[]) throws Exception {
> Class.forName("org.postgresql.Driver");
> leakConnection();
> System.gc();
> }
>
> private static void leakConnection() throws Exception {
> Connection conn = DriverManager.getConnection("jdbc:postgresql://
> localhost:5810/jurka?logUnclosedConnections=true","jurka","");
> }
>
> }
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: explain analyze is your friend
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-11-23 20:52 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-23 19:44 Re: BUG #2060: Issue with Data base connection Kris Jurka <jurka@ejurka.com>
2005-11-23 20:52 ` Dave Cramer <pg@fastcrypt.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox