pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Radim Kolar <hsn@filez.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: not fetching all query results
Date: Fri, 20 Jul 2012 13:16:28 +0800
Message-ID: <5008E9AC.8030507@ringerc.id.au> (raw)
In-Reply-To: <5005D257.9000100@filez.com>
References: <50044D96.3050902@filez.com>
	<5004D8F2.509@ringerc.id.au>
	<50055065.6080308@filez.com>
	<CADK3HH+UboShbu12+V3N21wtXoEW4vYPHydWVcn47n01i2jjug@mail.gmail.com>
	<500585D1.1000801@filez.com>
	<CADK3HHLx74z3c=YNvRYBsxErfVyifchzEcuwXgpgN4C_YAhtQQ@mail.gmail.com>
	<5005AB7C.5010508@filez.com>
	<CADK3HH+03Z3jik+G5XTpT9C0H3JzOgomYHL1fTNVi-ZJFdtRwQ@mail.gmail.com>
	<CADK3HH+HEot-uX0Vd23dN0nQW8Nrp2+E6gTFVN9TvLWHW7-cLw@mail.gmail.com>
	<5005C1AC.1030106@filez.com>
	<CADK3HHLOhLMBcMymZQAkWKubfvQKpkcZpaePH9yQJq-V0Ksucg@mail.gmail.com>
	<5005D257.9000100@filez.com>

On 07/18/2012 05:00 AM, Radim Kolar wrote:
> Dne 17.7.2012 22:05, Dave Cramer napsal(a):
>> Radim,
>>
>> As per our docs
>> http://jdbc.postgresql.org/documentation/91/query.html#fetchsize-example
>>
>> You need to do the select inside a transaction
> In transaction that simple example really works. Can it be fixed in 
> driver to work in autocommit mode? I will try scrollable cursor next.

I haven't looked into how the fetch size code works to see whether it's 
possible for it to operate in autocommit. A quick look at 
QueryExecutorImpl.sendOneQuery in 
org/postgresql/core/v3/QueryExecutorImpl.java finds the line:

   boolean usePortal = (flags & QueryExecutor.QUERY_FORWARD_CURSOR) != 0 
&& !noResults && !noMeta && fetchSize > 0 && !describeOnly;

given that and the subsequent code I don't understand why an explicit 
transaction is required. I've only done a tiny bit with the JDBC code, 
though, and only related to the authentication system and client 
certificates.



My rather blunt comment to you at the start of this thread was to point 
out that JDBC driver development doesn't just happen. It's a volunteer 
effort; people put their own time into this. Something like

     "It should not be that difficult to get it fixed. I am not 
interested in workarounds"

is pretty dismissive of the work you're already getting for free and 
without having contributed to it in any way. If you don't like it, one 
of your options is to do something about it yourself. The PgJDBC driver 
is open source, so rather than just asserting it can't be that 
difficult, you have the opportunity to prove your assertion by producing 
a patch that fixes your problem. Demanding that others spend their time 
fixing a problem you care about is a bit rude.

You can check the sources out here:

http://jdbc.postgresql.org/development/git.html

and there's developer info here:

http://jdbc.postgresql.org/development/intro.html

If you approach this with a the attitude of "this is causing a problem 
for me and I would love some help fixing it, any suggestions where I 
should start" you will probably get better results.

--
Craig Ringer

view thread (27+ messages)  latest in thread

Message-ID: <5008E9AC.8030507@ringerc.id.au>
Permalink:  ../5008E9AC.8030507@ringerc.id.au/
Also on:    postgresql.org/message-id/5008E9AC.8030507@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: ringerc@ringerc.id.au, hsn@filez.com, pg@fastcrypt.com
  Subject: Re: not fetching all query results
  In-Reply-To: <5008E9AC.8030507@ringerc.id.au>
  References: <50044D96.3050902@filez.com> <5004D8F2.509@ringerc.id.au> <50055065.6080308@filez.com> <CADK3HH+UboShbu12+V3N21wtXoEW4vYPHydWVcn47n01i2jjug@mail.gmail.com> <500585D1.1000801@filez.com> <CADK3HHLx74z3c=YNvRYBsxErfVyifchzEcuwXgpgN4C_YAhtQQ@mail.gmail.com> <5005AB7C.5010508@filez.com> <CADK3HH+03Z3jik+G5XTpT9C0H3JzOgomYHL1fTNVi-ZJFdtRwQ@mail.gmail.com> <CADK3HH+HEot-uX0Vd23dN0nQW8Nrp2+E6gTFVN9TvLWHW7-cLw@mail.gmail.com> <5005C1AC.1030106@filez.com> <CADK3HHLOhLMBcMymZQAkWKubfvQKpkcZpaePH9yQJq-V0Ksucg@mail.gmail.com> <5005D257.9000100@filez.com> <5008E9AC.8030507@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox