pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: Thomas Finneid <tfinneid@fcon.no>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: pooled prepared statements
Date: Thu, 14 May 2009 14:58:26 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0905141451530.12930@leary.csoft.net> (raw)
In-Reply-To: <4A0A17D8.5020808@opencloud.com>
References: <4A0978A3.6030900@fcon.no>
	<4A0A17D8.5020808@opencloud.com>



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



view thread (13+ messages)

Message-ID: <Pine.BSO.4.64.0905141451530.12930@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0905141451530.12930@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0905141451530.12930@leary.csoft.net

 · 

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: books@ejurka.com, oliver@opencloud.com, tfinneid@fcon.no
  Subject: Re: pooled prepared statements
  In-Reply-To: <Pine.BSO.4.64.0905141451530.12930@leary.csoft.net>
  References: <4A0978A3.6030900@fcon.no> <4A0A17D8.5020808@opencloud.com> <Pine.BSO.4.64.0905141451530.12930@leary.csoft.net>

* 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