Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 56273 invoked from network); 24 Jul 2006 09:47:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Jul 2006 09:47:34 -0000 Received: (qmail 88757 invoked by uid 500); 24 Jul 2006 09:47:33 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 88532 invoked by uid 500); 24 Jul 2006 09:47:33 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 88523 invoked by uid 99); 24 Jul 2006 09:47:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jul 2006 02:47:33 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.1.36] (HELO gmpea-pix-1.sun.com) (192.18.1.36) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jul 2006 02:47:32 -0700 Received: from d1-emea-09.sun.com ([192.18.2.119]) by gmpea-pix-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k6O9lBL6017535 for ; Mon, 24 Jul 2006 10:47:11 +0100 (BST) Received: from conversion-daemon.d1-emea-09.sun.com by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0J2W00901J4D6N00@d1-emea-09.sun.com> (original mail from Knut.Hatlen@Sun.COM) for derby-dev@db.apache.org; Mon, 24 Jul 2006 10:47:11 +0100 (BST) Received: from khepri19 ([129.159.112.231]) by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0J2W007PYJ6MJW97@d1-emea-09.sun.com> for derby-dev@db.apache.org; Mon, 24 Jul 2006 10:47:11 +0100 (BST) Date: Mon, 24 Jul 2006 11:47:10 +0200 From: Knut Anders Hatlen Subject: Are separate JDBC 4.0 versions of the DataSource classes really needed? Sender: Knut.Hatlen@Sun.COM To: derby-dev@db.apache.org Message-id: Organization: Sun Microsystems MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (usg-unix-v) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I started looking at our implementation of JDBC 4.0 data sources when I saw Rick updating the documentation with information about using Embedded*DataSource40 when running jvm>=1.6. I think it is problematic to have this split between pre-JDBC4 data sources and JDBC4 data sources for a number of reasons: - it is confusing for the users to have thirteen different data source implementations (EmbeddedSimpleDataSource, EmbeddedDataSource, EmbeddedConnectionPoolDataSource, EmbeddedXADataSource, EmbeddedDataSource40, EmbeddedConnectionPoolDataSource40, EmbeddedXADataSource40, ClientDataSource, ClientConnectionPoolDataSource, ClientXADataSource, ClientDataSource40, ClientConnectionPoolDataSource40, ClientXADataSource40) - it is difficult to maintain and document properly - applications that use data sources don't automatically start using JDBC 4.0 when upgrading to Derby 10.2 - how should we name the classes when we start implementing JDBC 5.0? DataSource40 will be misleading and DataSource50 will only increase the confusion (it would give a total of nineteen classes) For the internal implementation classes, this is not a big problem since the users don't see their names, but the DataSource classes are in our published API and therefore visible to our users. The rationale behind adding new classes for the JDBC 4.0 data sources was that they contained generic method signatures which wouldn't compile under jdk<1.6. The problematic method signatures are T unwrap(Class) createQueryObject(Class) createQueryObject(Class, DataSource) However, the actual signatures of the compiled methods are Object unwrap(Class) BaseQuery createQueryObject(Class) BaseQuery createQueryObject(Class, DataSource) I tried to put these methods with modified signatures into EmbeddedDataSource and removed them from Embedded*DataSource40. To make it compile, I had to modify the build.xml script to add an empty java.sql.BaseQuery class to the classpath when compiling EmbeddedDataSource. The conclusion from this experiment was: it compiles, it runs under jvm1.6 (jdbc40 suite passed without errors), and it runs under jvm1.3, jvm1.4 and jvm1.5. Does anyone see any serious problems with this approach? Although it's a dirty hack, I think it is much better than shipping a double set of data sources. -- Knut Anders