pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Vadim Nasardinov <vadimn@redhat.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: context classloader
Date: Wed, 19 Jan 2005 12:07:48 +1300
Message-ID: <41ED96C4.9030401@opencloud.com> (raw)
In-Reply-To: <200501181734.45152@vadim.nasardinov>
References: <Pine.BSO.4.56.0501170706010.29112@leary.csoft.net>
	<41ECF9FB.7040300@opencloud.com>
	<41ED8B01.1010209@opencloud.com>
	<200501181734.45152@vadim.nasardinov>

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



view thread (12+ messages)  latest in thread

Message-ID: <41ED96C4.9030401@opencloud.com>
Permalink:  ../41ED96C4.9030401@opencloud.com/
Also on:    postgresql.org/message-id/41ED96C4.9030401@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, vadimn@redhat.com
  Subject: Re: context classloader
  In-Reply-To: <41ED96C4.9030401@opencloud.com>
  References: <Pine.BSO.4.56.0501170706010.29112@leary.csoft.net> <41ECF9FB.7040300@opencloud.com> <41ED8B01.1010209@opencloud.com> <200501181734.45152@vadim.nasardinov> <41ED96C4.9030401@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox