X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 64DB532C7EF for ; Tue, 12 Oct 2004 11:34:28 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30054-07 for ; Tue, 12 Oct 2004 10:34:22 +0000 (GMT) Received: from mail.logi-track.com (burro.logi-track.com [213.239.193.212]) by svr1.postgresql.org (Postfix) with ESMTP id 19EE732C95A for ; Tue, 12 Oct 2004 11:33:06 +0100 (BST) Received: from kingfisher.intern.logi-track.com (G72ee.g.pppool.de [80.185.114.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logi-track.com (Postfix) with ESMTP id D3A1F30174; Tue, 12 Oct 2004 12:33:08 +0200 (CEST) Received: from kingfisher.intern.logi-track.com (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with SMTP id 009EBAB28C; Tue, 12 Oct 2004 12:33:02 +0200 (CEST) Date: Tue, 12 Oct 2004 12:33:02 +0200 From: Markus Schaber To: pgsql-jdbc@postgresql.org Cc: Ulrich Meis Subject: Re: A solution to the SSL customizing problem Message-ID: <20041012123302.3ca76eb1@kingfisher.intern.logi-track.com> In-Reply-To: <416B949E.5070502@opencloud.com> References: <200410111752.33375.kenobi@halifax.rwth-aachen.de> <200410120620.04002.kenobi@halifax.rwth-aachen.de> <416B5EBC.6060507@opencloud.com> <200410120742.30677.kenobi@halifax.rwth-aachen.de> <416B949E.5070502@opencloud.com> Organization: logi-track ag, =?ISO-8859-15?Q?z=FCrich?= X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-pc-linux-gnu) X-Face: Nx5T&>Nj$VrVPv}sC3IL&)TqHHOKCz/|)R$i"*r@w0{*I6w; UNU_hdl1J4NI_m{IMztq=>cmM}1gCLbAF+9\#CGkG8}Y{x%SuQ>1#t:; Z(|\qdd[i]HStki~#w1$TPF}:0w-7"S\Ev|_a$K wrote: > The situation I am thinking of is when you are configuring a DataSource= =20 > for use in a managed environment, e.g. appserver. The appserver knows=20 > nothing about the driver it is using beyond the standard JDBC interfaces= =20 > (and perhaps not even that, if it's using a JCA wrapper). This breaks as= =20 > soon as you have a magic method that needs to be called on the driver to= =20 > configure SSL properties. There is no way to teach the appserver how to= =20 > do this without hardwiring dependencies on the PG way of doing things..= =20 > which does not make for a very portable appserver! That's true. We were very happy to learn that the JBoss connection pooling uses wrappers that have a method to get the underlying original connection, so we could call addDataType() to add the postGIS classes. This left us with ugly code like: public static PGConnection unWrapPGConn(Connection conn) { PGConnection result =3D null; if (conn =3D=3D null) { log.error("trying to unWrapPGConn(null)!"); return null; } if (conn instanceof PGConnection) { result =3D (PGConnection) conn; } else if (conn instanceof WrappedConnection) { WrappedConnection w =3D (WrappedConnection) conn; try { result =3D unWrapPGConn(w.getUnderlyingConnection()); } catch (SQLException e) { log.error("unWrapPGConn: Could not get underyling SQL conne= ction!"); log.error(e.toString()); } } if (result =3D=3D null) { log.warn("unWrapPGConn called with unknown connection type."); log.warn("given Connection Class is: " + conn.getClass().getPac= kage() + "." + conn.getClass().getName()); } return result; } So, you can see that this is a real world problem. Imagine we would need to have our App portable to other app servers - this would not only complicate the source above. We also would need to provide the appropriate classes in the other environments, so the classloader can find them for the instanceof call - this could imply strange licence issues. Additionally, we currently have different apps with different needs running in the same app server - so fine grained configurability is a must. We cannot provide a single static method because the apps are developed and deployed independently. FIN, Markus --=20 markus schaber | dipl. informatiker logi-track ag | rennweg 14-16 | ch 8001 z=FCrich phone +41-43-888 62 52 | fax +41-43-888 62 53 mailto:schabios@logi-track.com | www.logi-track.com