pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tmp@nitwit.de
To: pgsql-jdbc@postgresql.org
Subject: Re: cursor "jdbc_curs_1" does not exist
Date: Thu, 17 Jun 2004 14:49:12 +0200
Message-ID: <200406171449.12604.tmp@nitwit.de> (raw)
In-Reply-To: <Pine.BSO.4.56.0406151234060.10395@leary.csoft.net>
References: <200406151736.27450.tmp@nitwit.de>
	<200406151853.58666.tmp@nitwit.de>
	<Pine.BSO.4.56.0406151234060.10395@leary.csoft.net>

On Tuesday 15 June 2004 19:38, you wrote:
> It is unclear what the differences here are.  You haven't shown the
> Statement creation and/or execution, so it's possible that you haven't
> used setFetchSize or you've specified a scrollable ResultSet.  Maybe auto
> commit is on.  Any of these will cause a cursor not to be used and the
> results will be fetched in bulk, so an intermediate commit won't cause any
> problems.  Maybe the query doesn't retrieve 100 rows, so it doesn't get to
> the commit part.

And why doesn't this work:

db.setAutoCommit(false);

final Statement select = 
db.createStatement(ResultSet.HOLD_CURSORS_OVER_COMMIT, 
ResultSet.CONCUR_READ_ONLY);
select.setFetchSize( Configuration.FETCH_SIZE );

int i = 0;
for( final ResultSet row = select.executeQuery( sql ); row.next(); i++)
{
	...
	insert.execute();
	continue;

	if (i%100==0) db.commit();
}

BTW ResultSet.TYPE_SCROLL_INSENSITIVE doesn't work either :-(



view thread (8+ messages)  latest in thread

Message-ID: <200406171449.12604.tmp@nitwit.de>
Permalink:  ../200406171449.12604.tmp@nitwit.de/
Also on:    postgresql.org/message-id/200406171449.12604.tmp@nitwit.de

 · 

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: tmp@nitwit.de
  Subject: Re: cursor "jdbc_curs_1" does not exist
  In-Reply-To: <200406171449.12604.tmp@nitwit.de>
  References: <200406151736.27450.tmp@nitwit.de> <200406151853.58666.tmp@nitwit.de> <Pine.BSO.4.56.0406151234060.10395@leary.csoft.net> <200406171449.12604.tmp@nitwit.de>

* 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