Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 1DBEA635E64 for ; Mon, 17 Aug 2009 04:27:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 68771-08 for ; Mon, 17 Aug 2009 07:27:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from n58.bullet.mail.sp1.yahoo.com (n58.bullet.mail.sp1.yahoo.com [98.136.44.46]) by mail.postgresql.org (Postfix) with SMTP id 14A0A632DFA for ; Mon, 17 Aug 2009 04:27:32 -0300 (ADT) Received: from [69.147.84.145] by n58.bullet.mail.sp1.yahoo.com with NNFMP; 17 Aug 2009 07:27:31 -0000 Received: from [69.147.84.114] by t8.bullet.mail.sp1.yahoo.com with NNFMP; 17 Aug 2009 07:27:31 -0000 Received: from [127.0.0.1] by omp203.mail.sp1.yahoo.com with NNFMP; 17 Aug 2009 07:27:31 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 559317.49066.bm@omp203.mail.sp1.yahoo.com Received: (qmail 2759 invoked by uid 60001); 17 Aug 2009 07:27:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1250494051; bh=q7t9g1E4N4KBehR+DgTHdTC+abh62FwzpC5yzNHDmC4=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=mhr34MTs9NdCeS0FWvRAZhi85uqQrHUGeWT0HbhhmjsUAcpr9OW797RQWcjH9hUvxlTyCBD3C7uY3NC16w3ekkYA+EpqMxfego1Yj+VQkOF0HX5L8BssQWxNWIiad844xnQsgMJXh3Z+GfV/c3f6rU6OZGemzMJ+WIu/EUllI5o= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=V5Mn9DvmwaaSBMTWmvn1cV4aIiLD9ESKA1JOvm5AnWG+SyD/9ppdfWOk5T1vJQ2kiPS8gs2sWY6BXQXRWsAaQOeuDIEnIsdkxUvmBooN40TcnX5Ie7JlrqdpDJtepolUiGS73O9Dq0068k+Nn5z6TJyzQzwr4LNLQUnd2A7QNuY=; Message-ID: <400613.99933.qm@web43143.mail.sp1.yahoo.com> X-YMail-OSG: jUyEjGQVM1l.5HLddqBWbUusKsFgy7QNg1eeEzz8YPYhqaWM44vxhCNWONkvUNHvYSIO5VUo_JjixkoZpaMq24cTmqyp8Wap3Hl58.ykWIZZ1n4Qx7u5EABWvPxsd0e1N97yZWxeryBvOorCknfjaAHsgYSsmL4c1GTBjTFGYUy927o1MImT7ic3tHHqyjKW3kxaVLBuWfqXdMQm49QJEr0aJgd2xAjV0KAMgxDuxYqPTvOs.PU1NAmGnZdG_N2Ns6qIZYQtmxiB1HzoyTFQIDbVgNN9ir4._2G14h6juIP9TjXBeD.Vk9ms4FmzWEL0EUI- Received: from [64.142.36.76] by web43143.mail.sp1.yahoo.com via HTTP; Mon, 17 Aug 2009 00:27:31 PDT X-Mailer: YahooMailRC/1358.27 YahooMailWebService/0.7.338.2 Date: Mon, 17 Aug 2009 00:27:31 -0700 (PDT) From: Michael Bell Subject: JDBC broken connection against Postgres 8.4 To: pgsql-jdbc@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/19 X-Sequence-Number: 19868 As you see below, something seems....whacked. A simple loop with an unpooled connection (code provided below) often gives an exception when connecting. The Thread.sleep statement has been made as high as 5000 ms, and exceptions still sporadically occur. I don't know if this is a JDBC driver issue or core server issue. Or something here. But the code is so simple.... Single box test (client, server on same machine, accessing 127.0.0.1) Postgesql 8.4.01 JDBC3 8.4.701 (also tried 8.3.603) Sun JDK 1.5_16 Windows XP SP3, 2GB RAM, 64MB-1GB heap Exception in thread "main" org.postgresql.util.PSQLException: The connection attempt failed. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:137) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66) at org.postgresql.jdbc2.AbstractJdbc2Connection.(AbstractJdbc2Connection.java:124) at org.postgresql.jdbc3.AbstractJdbc3Connection.(AbstractJdbc3Connection.java:30) at org.postgresql.jdbc3.Jdbc3Connection.(Jdbc3Connection.java:24) at org.postgresql.Driver.makeConnection(Driver.java:386) at org.postgresql.Driver.connect(Driver.java:260) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at com.gwava.db.DerbyConnectionPool.main(DerbyConnectionPool.java:193) Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135) at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104) at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73) at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259) at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:254) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:95) ... 9 more Code to reproduce: public static void main(String[] args) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException, InterruptedException { Connection con=null; Class.forName("org.postgresql.Driver").newInstance(); int count=0; while (count < 250) { try { System.out.println(count); con= DriverManager.getConnection("jdbc:postgresql://localhost/retain","mjb","turnip"); } finally { if (con != null) con.close(); } Thread.sleep(2); count++; } }