pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Bug in setFetchSize
4+ messages / 2 participants
[nested] [flat]

* Bug in setFetchSize
@ 2004-12-02 16:32  Dave Smith <dave.smith@candata.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Dave Smith @ 2004-12-02 16:32 UTC (permalink / raw)
  To: pgsql-jdbc

We are using pg80b1.308.jdbc3.jar with pg 7.4.5 and trying to use
setFetchSize on Statement.

Once we try and fetch outside the value we have set for fetchSize we get
ERROR: portal "C_4" does not exist

So it looks like you are using fetchSize as an absolute size, which is
not my reading of the spec.



-- 
Dave Smith
CANdata Systems Ltd
416-493-9020




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Bug in setFetchSize
@ 2004-12-02 21:20  Oliver Jowett <oliver@opencloud.com>
  parent: Dave Smith <dave.smith@candata.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Oliver Jowett @ 2004-12-02 21:20 UTC (permalink / raw)
  To: Dave Smith <dave.smith@candata.com>; +Cc: pgsql-jdbc

Dave Smith wrote:
> We are using pg80b1.308.jdbc3.jar with pg 7.4.5 and trying to use
> setFetchSize on Statement.
> 
> Once we try and fetch outside the value we have set for fetchSize we get
> ERROR: portal "C_4" does not exist

The only case I can think of this happening is if you are trying to use 
a ResultSet after the transaction that created it has committed or 
rolled back.

You're not meant to do that unless you specify HOLD_CURSORS_OVER_COMMIT 
(which the driver will currently reject as unsupported). The driver does 
not explicitly close ResultSets on commit, but the server closes the 
underlying cursor so you see this error.

If that's not the scenario, can you provide some sample code that 
demonstrates the problem?

> So it looks like you are using fetchSize as an absolute size, which is
> not my reading of the spec.

I don't understand your analysis.

-O



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Bug in setFetchSize
@ 2004-12-03 14:13  Dave Smith <dave.smith@candata.com>
  parent: Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Dave Smith @ 2004-12-03 14:13 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc

Does it matter if the setAutoCommit is true or false .. or is it just an
explicit commit(); call that would close the portal?

On Fri, 2004-12-03 at 05:20, Oliver Jowett wrote:
> Dave Smith wrote:
> > We are using pg80b1.308.jdbc3.jar with pg 7.4.5 and trying to use
> > setFetchSize on Statement.
> > 
> > Once we try and fetch outside the value we have set for fetchSize we get
> > ERROR: portal "C_4" does not exist
> 
> The only case I can think of this happening is if you are trying to use 
> a ResultSet after the transaction that created it has committed or 
> rolled back.
> 
> You're not meant to do that unless you specify HOLD_CURSORS_OVER_COMMIT 
> (which the driver will currently reject as unsupported). The driver does 
> not explicitly close ResultSets on commit, but the server closes the 
> underlying cursor so you see this error.
> 
> If that's not the scenario, can you provide some sample code that 
> demonstrates the problem?
> 
> > So it looks like you are using fetchSize as an absolute size, which is
> > not my reading of the spec.
> 
> I don't understand your analysis.
> 
> -O
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
-- 
Dave Smith
CANdata Systems Ltd
416-493-9020




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Bug in setFetchSize
@ 2004-12-03 20:40  Oliver Jowett <oliver@opencloud.com>
  parent: Dave Smith <dave.smith@candata.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Oliver Jowett @ 2004-12-03 20:40 UTC (permalink / raw)
  To: Dave Smith <dave.smith@candata.com>; +Cc: pgsql-jdbc

Dave Smith wrote:
> Does it matter if the setAutoCommit is true or false .. or is it just an
> explicit commit(); call that would close the portal?

If autocommit is true then the driver shouldn't be using cursors at all 
in theory (since they'd become invalid immediately).

Note that setAutoCommit() will do an implicit commit(), so if you're 
running with autocommit off, doing some queries, calling setAutoCommit, 
then trying to use the resultsets, then you will see similar problems.

Example code showing the problem?

-O



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2004-12-03 20:40 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-12-02 16:32 Bug in setFetchSize Dave Smith <dave.smith@candata.com>
2004-12-02 21:20 ` Oliver Jowett <oliver@opencloud.com>
2004-12-03 14:13   ` Dave Smith <dave.smith@candata.com>
2004-12-03 20:40     ` Oliver Jowett <oliver@opencloud.com>

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