pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: statement caching patch from Laszlo Hornyak for review
Date: Thu, 02 Aug 2007 22:45:34 +1200
Message-ID: <46B1B5CE.1050409@opencloud.com> (raw)
In-Reply-To: <2937D635-FCCB-471A-B1DA-AF0E0E0C18EB@fastcrypt.com>
References: <2937D635-FCCB-471A-B1DA-AF0E0E0C18EB@fastcrypt.com>

Dave Cramer wrote:
> Laszlo Hornyak has finished off the proof of concept patch that I 
> submitted a few months ago.

Any reason you wrote your own scan-the-whole-pool LRU rather than using 
something like LinkedHashMap?

I didn't dig into the code too closely but it looks like you are using 
the statement object directly with no wrapper. Doesn't this run the risk 
that you will resurrect a previously-closed statement? Normal statement 
objects have a one-way lifecycle, once they are closed they cannot be 
resurrected, if app clients have a reference to the real statement then 
potentially they'll see different behaviour when the statement starts 
getting reused. That smells dangerous; not because any sane application 
will rely on it, but because it will be a source of very hard to find 
bugs. (e.g. it's fairly common and harmless to close an already-closed 
statement.. but that's suddenly disastrous if the statement has actually 
been pooled & reused in the meantime)

Are all the abstract/interface/concrete-implementation classes strictly 
necessary to get it operating under multiple JDBC versions? They are a 
real pain when it comes to maintaining the code. For example I can't see 
offhand why you need to do that with StatementPool.

-O



view thread (19+ messages)  latest in thread

Message-ID: <46B1B5CE.1050409@opencloud.com>
Permalink:  ../46B1B5CE.1050409@opencloud.com/
Also on:    postgresql.org/message-id/46B1B5CE.1050409@opencloud.com

 · 

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: oliver@opencloud.com, pg@fastcrypt.com
  Subject: Re: statement caching patch from Laszlo Hornyak for review
  In-Reply-To: <46B1B5CE.1050409@opencloud.com>
  References: <2937D635-FCCB-471A-B1DA-AF0E0E0C18EB@fastcrypt.com> <46B1B5CE.1050409@opencloud.com>

* 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