Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 8CC689FB314 for ; Fri, 7 Sep 2007 12:07:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 27704-01-2 for ; Fri, 7 Sep 2007 12:07:04 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id 7733E9FB449 for ; Fri, 7 Sep 2007 12:06:14 -0300 (ADT) thread-index: AcfxYKmte5TbXPRFQT+3s1XLiD/fjw== Received: from [192.168.1.33] ([82.13.40.32]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Sep 2007 11:06:25 -0400 Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4073 Message-ID: <46E168C1.2050003@enterprisedb.com> Date: Fri, 07 Sep 2007 16:05:37 +0100 From: "Heikki Linnakangas" User-Agent: Icedove 1.5.0.12 (X11/20070730) MIME-Version: 1.0 To: =?iso-8859-1?B?TOFzemzzIEhvcm554Ws=?= Cc: "List" Subject: Re: Fwd: Caching driver on pgFoundry? References: <200709050825.27080.josh@agliodbs.com> <200709050937.29027.josh@agliodbs.com> <8FD2948B-9513-4611-9310-908CA253EECD@fastcrypt.com> <46DF0F70.50802@enterprisedb.com> <1189156640.4175.464.camel@ebony.site> <30775804-224A-4807-BDDD-5ACB9A173BCA@fastcrypt.com> <46E14E80.9030409@opencloud.com> <809bf8d30709070655j2458a13q64cb228ee0c172b2@mail.gmail.com> <809bf8d30709070656q39ffc0fcp8eae7f0ded2d2039@mail.gmail.com> In-Reply-To: <809bf8d30709070656q39ffc0fcp8eae7f0ded2d2039@mail.gmail.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 07 Sep 2007 15:06:26.0250 (UTC) FILETIME=[A946EAA0:01C7F160] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/69 X-Sequence-Number: 17491 László Hornyák wrote: > On 07/09/07, Oliver Jowett wrote: >> What is the implementation advantage of making statement pooling part of >> the main driver? There are maintenance issues which count *against* it >> being part of the driver so you need to provide a good reason to include >> it. > > There are two main reasons I can mention: > - JDBC 4 allows prepared statement pooling (Which is optional, the driver > can ignore the programs request to cache the prepared statement, and I > believe it enables some kind of early optimization for those who like to do > early optimizations. But that is just my opinion, but JDBC 4 specification > expects drivers to deal with it. Time will tell, maybe data access layers > like hibernate or JPA implementations in the future will use it) see > http://java.sun.com/javase/6/docs/api/java/sql/Statement.html#setPoolable%28boolean%29 As far as I can see, there's nothing in the spec that you can't implement in a generic wrapper. The methods added in JDBC4 allow the application to explicitly ask the connection pool/statement cache to not cache a statement. Implementation of that feature is exactly the same, whether the statement cache comes with the driver, the application server, or as a separate module. > - Clients that do not use DataSource, but only DriverManager can gain > significant speed improvement. Now, you get prepapred statement caching if > the wrapper ( e.g. DBCP) gives it, not if you use a pg connection directly. Nothing stops you from using the caching wrapper with the DriverManager interface. I believe DBCP supports that as well. > Packaging issues are IMO fairly irrelevant because if you must give a >> single package to your users, you can always take the base driver and a >> separate pooling wrapper, package them together, and say "Hey look here >> is the statement-pooling postgresql JDBC driver". > > Yes, any developer can do that, but it would probably save some time for > developers if they wouldn't have to. Frankly I don't understand what the benefit of a combined jar is. Surely if you can add one jar to your classpath, you can add two. But I won't object if someone wants to maintain such a combined jar; it's not going to harm me or anyone else that such a thing exists, as long as you're not forced to use it. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com