Skip site navigation (1) Skip section navigation (2)

Re: [JDBC] BUG #2060: Issue with Data base connection

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Kris Jurka <jurka(at)ejurka(dot)com>
Cc: kalisetty manideep <mani7deep(at)yahoo(dot)com>, pgsql-jdbc(at)postgresql(dot)org, pgsql-bugs(at)postgresql(dot)org
Subject: Re: [JDBC] BUG #2060: Issue with Data base connection
Date: 2005-11-23 20:52:43
Message-ID: D0184BF9-F72A-4AB2-8BDE-32DD25148906@fastcrypt.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-jdbc
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


In response to

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2005-11-23 21:04:29
Subject: Re: BUG #2056: to_char no long takes time as input?
Previous:From: Tom LaneDate: 2005-11-23 20:30:01
Subject: Re: Incorrect column identifer using AS in SELECT statement on a VIEW.

pgsql-jdbc by date

Next:From: Kevin GrittnerDate: 2005-11-23 21:30:34
Subject: Re: rollback ignored until end of transaction block
Previous:From: Kris JurkaDate: 2005-11-23 19:44:52
Subject: Re: BUG #2060: Issue with Data base connection

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group