Re: JDBC causing the connection to close after executing a COPY command

From: Altaf Malik <mmalik_altaf(at)yahoo(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC causing the connection to close after executing a COPY command
Date: 2007-12-14 21:50:52
Message-ID: 70448.97215.qm@web39108.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I am attaching the new patch.

For CopyInResponse, client will send a CopyFail message and server won't wait for the client input. For CopyOutResponse, exception is generated for only CopyOutResponse and not for every CopyData message. Also slightly changed the 'ignoring' mechanism from reading the message to ignore it to skipping the message. I hope this
will also improve the performance.

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

Kris Jurka <books(at)ejurka(dot)com> wrote:

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

Best Regards
Muhammad Altaf Malik
Sr. Software Engineer,
EnterpriseDB (SMC) (pvt) Ltd.
3rd floor, Software Technology Park,
Islamabad. Ph: +92 (051) 2873815
Cell: 0321-5177961


---------------------------------
Never miss a thing. Make Yahoo your homepage.

Attachment Content-Type Size
pg_copy.diff text/x-patch 3.8 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2007-12-15 16:19:04 Re: how to set a PreparedStatement column of XML type in 8.3?
Previous Message Kris Jurka 2007-12-14 20:31:08 Re: how to set a PreparedStatement column of XML type in 8.3?