Re: Trouble with COPY IN - Mailing list pgsql-jdbc

From Matthew Wakeling
Subject Re: Trouble with COPY IN
Date
Msg-id alpine.DEB.2.00.1007201507500.8895@aragorn.flymine.org
Whole thread Raw
In response to Re: Trouble with COPY IN  (Matthew Wakeling <matthew@flymine.org>)
Responses Re: Trouble with COPY IN  (Matthew Wakeling <matthew@flymine.org>)
Re: Trouble with COPY IN  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
On Tue, 20 Jul 2010, Matthew Wakeling wrote:
> After a little more investigation, it appears that
> core.v3.QueryExecutorImpl.unlock() is being called before
> core.v3.QueryExecutorImpl.endCopy(), in
> core.v3.QueryExecutorImpl.processCopyResults() apparently because it receives
> a "Z", called by core.v3.QueryExecutorImpl.writeToCopy(). Investigating
> further.

Okay, have investigated a little further. It seems that the server may be
responding to the client a little too quickly with the "all done" message.
Here is a sequence of events in core.v3.QueryExecutorImpl:


We call startCopy(). It calls processCopyResults().
In processCopyResults, we receive character G, and we lock.

We call writeToCopy(). It calls processCopyResults().
We receive character C.
We receive character Z, and unlock.

We call endCopy(), which tries to unlock and fails.


So, should the unlocking happen elsewhere, or should endCopy not require a
lock?

Matthew

--
 Jadzia: Don't forget the 34th rule of acquisition: Peace is good for business.
 Quark:  That's the 35th.
 Jadzia: Oh yes, that's right. What's the 34th again?
 Quark:  War is good for business. It's easy to get them mixed up.

pgsql-jdbc by date:

Previous
From: Matthew Wakeling
Date:
Subject: Re: Trouble with COPY IN
Next
From: Matthew Wakeling
Date:
Subject: Re: Trouble with COPY IN