Re: pooled prepared statements

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: pooled prepared statements
Дата
Msg-id Pine.BSO.4.64.0905141451530.12930@leary.csoft.net
обсуждение исходный текст
Ответ на Re: pooled prepared statements  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc

On Wed, 13 May 2009, Oliver Jowett wrote:

> Thomas Finneid wrote:
>
>> When a PreparedStatment is created by a pooled connection, as far as I
>> understand if, that creation happens on the server side, and a
>> reference, of sorts, is returned to the client jdbc.
>
> More or less, yes. (Assuming you're reusing the statement, not just
> using it once and discarding it).
>

It really depends on the driver and connection pool that you are using.
The idea of having a PreparedStatement cache (that doesn't require
retaining a reference to the PreparedStatement) has been suggested for the
driver, but rejected.  A connection pool which proxies the real connection
can provide this functionality instead.  The pooler provided with the
postgresql driver does not do this, but for example DBCP can.

So as long as your pool or driver are reasonably smart, don't overthink
this and let them handle it for you.

Kris Jurka

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: COPY support: plan and progress
Следующее
От: David Rees
Дата:
Сообщение: Re: v604 in Maven