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