Re: [Hibernate] ClassLoader injection

2006-02-02 Thread baliuka juozas
ing through the current ejb3 spec. > >> > >> the problem is that if it is really necessary to > >> have a *third* external > >> classloader > >> which is neither available via someclass.forName > nor > >> TCL then we need to > >> car

Re: [Hibernate] ClassLoader injection

2006-02-02 Thread Max Rydahl Andersen
age- > From: Max Andersen > Sent: Thursday, February 02, 2006 3:09 PM > To: Scott M Stark; Emmanuel Bernard; Bill Burke > Cc: Hibernate development > Subject: Re: [Hibernate] ClassLoader injection > > hi, > > Why is the tcl not the right one even when generating classes

Re: [Hibernate] ClassLoader injection

2006-02-02 Thread baliuka juozas
hird* external > classloader > which is neither available via someclass.forName nor > TCL then we need to > carry this classloader around and pass it on to hard > to reach places. > > /max > > > > > -Original Message- > > From: Max Andersen > &

Re: [Hibernate] ClassLoader injection

2006-02-02 Thread Max Rydahl Andersen
assloader around and pass it on to hard to reach places. /max -Original Message- From: Max Andersen Sent: Thursday, February 02, 2006 3:09 PM To: Scott M Stark; Emmanuel Bernard; Bill Burke Cc: Hibernate development Subject: Re: [Hibernate] ClassLoader injection hi, Why is the tcl n

RE: [Hibernate] ClassLoader injection

2006-02-02 Thread Scott M Stark
t browsing through the current ejb3 spec. -Original Message- From: Max Andersen Sent: Thursday, February 02, 2006 3:09 PM To: Scott M Stark; Emmanuel Bernard; Bill Burke Cc: Hibernate development Subject: Re: [Hibernate] ClassLoader injection hi, Why is the tcl not the right one even when

Re: [Hibernate] ClassLoader injection

2006-02-02 Thread Max Rydahl Andersen
esday, January 31, 2006 11:53 PM To: Emmanuel Bernard; Bill Burke Cc: Hibernate development; Scott M Stark Subject: Re: [Hibernate] ClassLoader injection Hi, to bill, yes I know ctx current thread is the only way, that was my whole point (using ctx current thread in hibernate was actually the first

RE: [Hibernate] ClassLoader injection

2006-02-02 Thread Scott M Stark
for resources and do annotation searching. -Original Message- From: Max Andersen Sent: Tuesday, January 31, 2006 11:53 PM To: Emmanuel Bernard; Bill Burke Cc: Hibernate development; Scott M Stark Subject: Re: [Hibernate] ClassLoader injection Hi, to bill, yes I know ctx current thread

Re: [Hibernate] ClassLoader injection

2006-02-01 Thread Max Rydahl Andersen
cglibs is one of the exceptional cases - it *has* to load from the classloader it was generated to be consistent. Hibernate is the same league in this case as log4j, jbossaop, spring, xml-parsers, freemarker, velocity, whatever extenable/configurable library i can think of ;) /max Hibernate is

Re: [Hibernate] ClassLoader injection

2006-02-01 Thread baliuka juozas
Hibernate is an exceptional case, it can be used as internal container library to provide EJB3 implementation and all libraries used by hibernate must be designed with this assumption too. CGLIB is designed to be used by container implementation, but it is very simple in our case, correct class lo

Re: [Hibernate] ClassLoader injection

2006-02-01 Thread Max Rydahl Andersen
On Wed, 01 Feb 2006 08:17:33 +0100, baliuka juozas <[EMAIL PROTECTED]> wrote: Thread.getContextCL() is the only way. If a library doesn't use Thread.getCCL() then it is a poorly written library. No, this kind of library it just not designed to be used as shared library, if library is deplo

Re: [Hibernate] ClassLoader injection

2006-01-31 Thread baliuka juozas
> > Thread.getContextCL() is the only way. If a library > doesn't use > Thread.getCCL() then it is a poorly written library. > No, this kind of library it just not designed to be used as shared library, if library is deployed with application then "MyClass.class.getClassLoader()" is the right c

Re: [Hibernate] ClassLoader injection

2006-01-31 Thread Max Rydahl Andersen
Hi, to bill, yes I know ctx current thread is the only way, that was my whole point (using ctx current thread in hibernate was actually the first patch i provided to hibernate core ;) and yes, having a third classloader concept in the spec sounds like a very broken thing. I would love to h

Re: [Hibernate] ClassLoader injection

2006-01-31 Thread Bill Burke
Emmanuel Bernard wrote: The RI team is going to creak, but I'm inclined to remove it as well. AS for your first remark, what's wrong with doing getResource with the regular classloader? I don't get it. IN jboss, within the same ear, all ejbs/pars are in the same classloader domain. Do g

Re: [Hibernate] ClassLoader injection

2006-01-31 Thread Emmanuel Bernard
The RI team is going to creak, but I'm inclined to remove it as well. AS for your first remark, what's wrong with doing getResource with the regular classloader? I don't get it. Bill Burke wrote: I understand the need for PUInfo.getNewTempClassLoader() as getResource("META-INF/persistence.xm

Re: [Hibernate] ClassLoader injection

2006-01-31 Thread Bill Burke
I understand the need for PUInfo.getNewTempClassLoader() as getResource("META-INF/persistence.xml") may/will return multiples. Also, you may want to introspect the class for annotations before you decide what needs to be bytecode massaged. As for getClassLoader()? I'm not sure of the reasonin

Re: [Hibernate] ClassLoader injection

2006-01-31 Thread Emmanuel Bernard
Year I'm aware of that Bill :-) But in this case, and like Max said, why on earth the PersistenceUnitInfo has a getClassLoader() method instead of using the context CL? Bill Burke wrote: Max Rydahl Andersen wrote: If it is for the spec then I would argue that the spec is very wrong since

Re: [Hibernate] ClassLoader injection

2006-01-31 Thread Bill Burke
Max Rydahl Andersen wrote: If it is for the spec then I would argue that the spec is very wrong since it will break all other kind of stuff. Like how will you convince all the external libraries hibernate uses to use your "magic" classloader ? (e.g. log4j, dom4j, cglib, yada, yada) Thr

Re: [Hibernate] ClassLoader injection

2006-01-31 Thread Max Rydahl Andersen
For EJB3 and app server integration, I need to inject a specific classloader that may load all classes and resources needed by Hibernate. the current thread context classloader is meant for this purpose; why is it required to use a 3rd classloader mechanism ? There are 2 distinct needs for a

[Hibernate] ClassLoader injection

2006-01-31 Thread Emmanuel Bernard
Hi guys, For EJB3 and app server integration, I need to inject a specific classloader that may load all classes and resources needed by Hibernate. There are 2 distinct needs for a classloader in Hibernate Configuration time (ie until the SF is built) Runtime (session time use) For Configuratio