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 94A133A1CF0 for ; Tue, 18 Jan 2005 23:08:12 +0000 (GMT) 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 83819-07 for ; Tue, 18 Jan 2005 23:08:01 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 02C853A298E for ; Tue, 18 Jan 2005 23:08:02 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1Cr2Rz-0006x7-00; Wed, 19 Jan 2005 12:07:51 +1300 Message-ID: <41ED96C4.9030401@opencloud.com> Date: Wed, 19 Jan 2005 12:07:48 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Vadim Nasardinov Cc: pgsql-jdbc@postgresql.org Subject: Re: context classloader References: <41ECF9FB.7040300@opencloud.com> <41ED8B01.1010209@opencloud.com> <200501181734.45152@vadim.nasardinov> In-Reply-To: <200501181734.45152@vadim.nasardinov> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/188 X-Sequence-Number: 12068 Vadim Nasardinov wrote: > Another reasonable course of action might be to try the context classloader: > http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#getContextClassLoader%28%29 > > This would typically have the system classloader in its parent hierarchy, > but it may also give you access to locations that the system classloader > cannot see. I am of the opinion that thread context classloaders are evil and should be avoided if at all possible -- they make code fragile and sensitive to caller context (almost by definition!) Also it'd mean that we would have to load the defaults on every call to getConnection(), rather than once per Driver instance (i.e. most probably exactly once). Does it make sense to have the driver defaults change depending on who is obtaining the connection? -O