Create one OSGiClassLoader per persistence unit

Description

From https://github.com/hibernate/hibernate-orm/pull/491:

The way the current OSGiClassLoader works isn't ideal because there is one shared instance for the whole framework, rather than one per persistence unit, meaning that class name collisions between bundles are still a potential problem, however the new implementation is much more selective about what it searches for than it used to be so this situation is far less likely to occur.

In 4.2, this isn't possible – too much of ORM relies on TCCL and had to be "corrected" with static variable bandaids. Creating one specific classloader per persistence unit will most likely require the separation provided by 5.0. Initially marking that as a target release, although this could be researched in 4.3 as well.

Activity

Show:

Brett Meyer August 19, 2013 at 3:51 PM

Resolving. Most "core" concepts are corrected. However, Dialects, type descriptors, etc. still have some static CL uses. We'll follow up on a case-by-case basis as issues come up.

Brett Meyer July 29, 2013 at 10:00 PM

Brett Meyer July 29, 2013 at 8:50 PM

Partially implemented in https://github.com/brmeyer/hibernate-orm/tree/metamodel_HHH-8118. For the most part, it's a matter of wiring the BindingContext or ServiceRegistry to many chains.

Areas still needing work:

1.) Dialects. Add ServiceRegistry to the static methods and the constructors?
2.) org.hibernate.engine.jdbc.*Proxy#getProxyClassLoader()
3.) org.hibernate.type. A few types do class lookups.

org.hibernate.cfg, org.hibernate.internal.util.xml, org.hibernate.mapping, etc. were ignored since they'll be removed or repurposed in 5.0.

Fixed

Assignee

Reporter

Priority

Created March 27, 2013 at 7:04 PM
Updated December 3, 2024 at 12:46 PM
Resolved August 19, 2013 at 3:51 PM
Loading...