Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 7CFAF2E34CB for ; Fri, 14 Dec 2007 07:11:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 31014-03 for ; Fri, 14 Dec 2007 07:11:18 -0400 (AST) Received: from web39108.mail.mud.yahoo.com (web39108.mail.mud.yahoo.com [209.191.87.227]) by postgresql.org (Postfix) with SMTP id E407D2E3472 for ; Fri, 14 Dec 2007 07:11:23 -0400 (AST) Received: (qmail 80225 invoked by uid 60001); 14 Dec 2007 11:11:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=r6EJaFTsIdRQ34209XloePeFkqjxB9DTll2YdswaRcaBi+2PvFGisxrN3SUiu8VxPR7dQDFWY5gudg2rxnrwOW16fJA1segiEtnHO7xaQxG9lpFEjSA0yDAfeBUGHnr/SNPmocTDtYUSN4vqEfCrRM/BYWrYGpnLrX7NseOnXHU=; X-YMail-OSG: 2fmuqbgVM1lQWaqr8jY4mWbrctPb91FZkBlp.FxWypSiF6sUOX5GdC1HEITLbgw03S56G0v.O5iopfhbsBiQrfeNxZoLQDobMyQF5G_w_h77cmgBNwGIfxpWOg-- Received: from [58.65.169.82] by web39108.mail.mud.yahoo.com via HTTP; Fri, 14 Dec 2007 03:11:22 PST Date: Fri, 14 Dec 2007 03:11:22 -0800 (PST) From: Altaf Malik Subject: Re: JDBC causing the connection to close after executing a COPY command To: Kris Jurka Cc: Dave Cramer , pgsql-jdbc@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-284176445-1197630682=:78807" Content-Transfer-Encoding: 8bit Message-ID: <577968.78807.qm@web39108.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/116 X-Sequence-Number: 17971 --0-284176445-1197630682=:78807 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Yes i'll take care of that and send another patch. Regards, Altaf Malik EnterpriseDB http://www.enterprisedb.com/ Kris Jurka wrote: 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 --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search. --0-284176445-1197630682=:78807 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Yes i'll take care of that and send another patch.

Regards,
Altaf Malik
EnterpriseDB
http://www.enterprisedb.com/

Kris Jurka <books@ejurka.com> wrote:


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


Looking for last minute shopping deals? Find them fast with Yahoo! Search. --0-284176445-1197630682=:78807--