Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 91C1B2E358A for ; Thu, 13 Dec 2007 17:31:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 72424-06 for ; Thu, 13 Dec 2007 17:31:13 -0400 (AST) Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 58E432E356F for ; Thu, 13 Dec 2007 17:31:13 -0400 (AST) Received: (qmail 30758 invoked by uid 1112); 13 Dec 2007 21:31:12 -0000 Date: Thu, 13 Dec 2007 16:31:12 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Altaf Malik cc: Dave Cramer , pgsql-jdbc@postgresql.org Subject: Re: JDBC causing the connection to close after executing a COPY command In-Reply-To: <35579.58043.qm@web39104.mail.mud.yahoo.com> Message-ID: References: <35579.58043.qm@web39104.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/96 X-Sequence-Number: 17951 On Thu, 13 Dec 2007, Altaf Malik wrote: > I debugged little more and found that this is not because of incomplete > copy support. When a response to any of the copy operations is received, > JDBC reads next few bytes to ignore the response. But unfortunately > driver reads extra four bytes which is the RFQ message so the RFQ > message gets corrupted and IOException is thrown considering it as an > unknown packet. Good catch. > I am attaching a patch that fixes this issue and driver works smoothly > even after giving the error on copy response. > Sort of. In the case of copying data from the server, if you do have a large table, you'll generate a SQLException for every row of the copy result which isn't great, but I guess it's better than failing completely. Trying to copy out a single column table of 100k integers took about seven minutes and 150 MB of memory here. Also, it doesn't work for copying data to the server. In that case the server is sitting waiting for data and the driver is waiting for the server and nothing happens. That was the case before, so this is no worse. Do you have plans to work on this further or shall I apply just this minor improvement? Kris Jurka