Re: cursor "jdbc_curs_1" does not exist

Поиск
Список
Период
Сортировка
От tmp@nitwit.de
Тема Re: cursor "jdbc_curs_1" does not exist
Дата
Msg-id 200406171449.12604.tmp@nitwit.de
обсуждение исходный текст
Ответ на Re: cursor "jdbc_curs_1" does not exist  (Kris Jurka <books@ejurka.com>)
Ответы Re: cursor "jdbc_curs_1" does not exist  (Oliver Jowett <oliver@opencloud.com>)
Список 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 :-(

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Prepare Statement
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: cursor "jdbc_curs_1" does not exist