Re: Prepared Statements vs. pgbouncer

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Prepared Statements vs. pgbouncer
Дата
Msg-id 4701647C.8050305@opencloud.com
обсуждение исходный текст
Ответ на Re: Prepared Statements vs. pgbouncer  (Oliver Jowett <oliver@opencloud.com>)
Ответы Re: Prepared Statements vs. pgbouncer
Список pgsql-jdbc
Oliver Jowett wrote:
> Paul Lindner wrote:
>
>> Why doesn't the Postgres JDBC driver use cursors for ResultSets
>> instead of creating prepared statements?  Is this not supported in the
>> v3 protocol?  (I'd answer this question myself, but no time to read
>> code at the moment...)
>
> It uses portals which are the v3 equivalent of cursors.

To elaborate a bit more: you need a statement before you can create a
portal, and the unnamed statement is no use for this particular case as
we need the portal to live despite reuse of the unnamed statement, and
the implicit close of the unnamed statement on reuse also causes any
dependant portal to close. So we must use a named statement so that we
can control the lifetime of the portal correctly.

-O

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

Предыдущее
От: Paul Lindner
Дата:
Сообщение: Re: Prepared Statements vs. pgbouncer
Следующее
От: Paul Lindner
Дата:
Сообщение: Re: Prepared Statements vs. pgbouncer