Re: cursor "jdbc_curs_1" does not exist

From: tmp(at)nitwit(dot)de
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: cursor "jdbc_curs_1" does not exist
Date: 2004-06-17 12:49:12
Message-ID: 200406171449.12604.tmp@nitwit.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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 :-(

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-06-17 13:17:03 Re: cursor "jdbc_curs_1" does not exist
Previous Message Amit Handa 2004-06-17 04:54:48 Re: Support for JDK 1.5 RowSets