Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id C70509F9B32 for ; Thu, 9 Nov 2006 09:37:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 67829-01-2 for ; Thu, 9 Nov 2006 09:37:52 -0400 (AST) X-Greylist: delayed 00:26:15.656343 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id E0C939FB28D for ; Thu, 9 Nov 2006 09:37:51 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from thor.netera.se (thor.netera.se [85.112.172.11]) by svr4.postgresql.org (Postfix) with ESMTP id A635E5AF8A6 for ; Thu, 9 Nov 2006 13:11:34 +0000 (GMT) Received: from [192.168.2.189] (c-b8d1e255.79-8-64736c12.cust.bredbandsbolaget.se [85.226.209.184]) by thor.netera.se (Postfix) with ESMTP id 23F7C13AC049 for ; Thu, 9 Nov 2006 14:11:30 +0100 (CET) Message-ID: <45532921.7030303@relevanttraffic.com> Date: Thu, 09 Nov 2006 14:12:01 +0100 From: =?ISO-8859-1?Q?H=E5kan_Jacobsson?= User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Need help with org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/38 X-Sequence-Number: 16080 Hi, I´ve written a small JDBC-application. I´m quering a large table in a postgreSQL database (version 8.08 and I´m using the postgresql-8.1-407.jdbc3 driver). I need to update a lot of the rows in the table and I try to do this 'on-the-fly' - that is, I use one statement to select the rows and while looping over the ResultSet I use another one to update the row if needed. The updates are executing very slowly, which is due to the fact that the database server is slow. I keep getting this exception: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:214) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:347) at se.puzzled.ip.InsertIPCountryToDatabase.updateCountryCodesInUclickUsingVector(InsertIPCountryToDatabase.java:239) at se.puzzled.updater.CountryDriver.main(CountryDriver.java:30) Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:256) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1163) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) ... 5 more Some updates execute correctly, but then the application crashes with the exception. I´ve seen other posts concerning this exception, but what I´d like is a way to prohibit the exception within my Java code - haven´t found any such solution in the posts that I´ve read. Any help would be very much appreciated!