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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Fix more unit test connection leaks





On Sun, 22 Jul 2007, Mikko Tiihonen wrote:

I found some more connection leaks from the test cases.


Yeah, I started looking at your original patch and figured there would be more, so I enabled the code to report the location of any opened but unclosed connections (in the attached hack). Does your latest patch pass this test?

Kris Jurka
Index: org/postgresql/test/TestUtil.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/TestUtil.java,v
retrieving revision 1.22
diff -c -r1.22 TestUtil.java
*** org/postgresql/test/TestUtil.java	1 Dec 2006 08:53:46 -0000	1.22
--- org/postgresql/test/TestUtil.java	22 Jul 2007 01:29:49 -0000
***************
*** 35,40 ****
--- 35,41 ----
                                  + getDatabase() 
                                  + "?prepareThreshold=" + getPrepareThreshold()
                                  + "&loglevel=" + getLogLevel()
+ 				+ "&logUnclosedConnections=true"
                                  + protocolVersion;
      }
  
Index: org/postgresql/ds/common/BaseDataSource.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/ds/common/BaseDataSource.java,v
retrieving revision 1.8
diff -c -r1.8 BaseDataSource.java
*** org/postgresql/ds/common/BaseDataSource.java	16 Jul 2007 05:16:45 -0000	1.8
--- org/postgresql/ds/common/BaseDataSource.java	22 Jul 2007 01:29:49 -0000
***************
*** 267,273 ****
      {
          return
              "jdbc:postgresql://" + serverName + (portNumber == 0 ? "" : ":" + portNumber) + "/" + databaseName +
!             "?loginTimeout=" + loginTimeout + "&prepareThreshold=" + prepareThreshold;
      }
  
      /**
--- 267,273 ----
      {
          return
              "jdbc:postgresql://" + serverName + (portNumber == 0 ? "" : ":" + portNumber) + "/" + databaseName +
!             "?loginTimeout=" + loginTimeout + "&prepareThreshold=" + prepareThreshold + "&logUnclosedConnections=true";
      }
  
      /**


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group