HHH-13696 Use PU Info Classloader when booting in OsgiPersistenceProvider
This commit is contained in:
parent
1dd787eaa1
commit
051a7d9b7c
|
@ -92,8 +92,15 @@ public class OsgiPersistenceProvider extends HibernatePersistenceProvider {
|
||||||
|
|
||||||
osgiClassLoader.addClassLoader( info.getClassLoader() );
|
osgiClassLoader.addClassLoader( info.getClassLoader() );
|
||||||
|
|
||||||
return Bootstrap.getEntityManagerFactoryBuilder( info, settings,
|
ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
|
||||||
new OSGiClassLoaderServiceImpl( osgiClassLoader, osgiServiceUtil ) ).build();
|
try {
|
||||||
|
Thread.currentThread().setContextClassLoader(info.getClassLoader());
|
||||||
|
return Bootstrap.getEntityManagerFactoryBuilder( info, settings,
|
||||||
|
new OSGiClassLoaderServiceImpl( osgiClassLoader, osgiServiceUtil ) ).build();
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
Thread.currentThread().setContextClassLoader(prevCL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
Loading…
Reference in New Issue