Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D63BE9FB232 for ; Thu, 2 Aug 2007 07:45:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 00673-01 for ; Thu, 2 Aug 2007 07:45:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 803FD9FB1F0 for ; Thu, 2 Aug 2007 07:45:20 -0300 (ADT) Received: from 222-154-135-183.jetstream.xtra.co.nz ([222.154.135.183] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IGYB6-00016W-5l; Thu, 02 Aug 2007 22:45:12 +1200 Message-ID: <46B1B5CE.1050409@opencloud.com> Date: Thu, 02 Aug 2007 22:45:34 +1200 From: Oliver Jowett User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: Dave Cramer CC: List Subject: Re: statement caching patch from Laszlo Hornyak for review References: <2937D635-FCCB-471A-B1DA-AF0E0E0C18EB@fastcrypt.com> In-Reply-To: <2937D635-FCCB-471A-B1DA-AF0E0E0C18EB@fastcrypt.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/7 X-Sequence-Number: 17320 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