properties.put(PersistenceUnitProperties.CLASSLOADER, dcl);
if (initializationProperties != null){
properties.putAll(initializationProperties);
}
EntityManagerFactoryImpl factory = (EntityManagerFactoryImpl) Persistence.createEntityManagerFactory(persistenceUnit, properties);
ClassLoader sessionLoader = factory.getServerSession().getLoader();
if (!DynamicClassLoader.class.isAssignableFrom(sessionLoader.getClass()) ) {
properties = new HashMap<String, Object>();
dcl = new DynamicClassLoader(sessionLoader);
properties.put(PersistenceUnitProperties.CLASSLOADER, dcl);
if (initializationProperties != null){
properties.putAll(initializationProperties);
}
factory.refreshMetadata(properties);
}
if (factory != null){
app = bootstrapPersistenceContext(persistenceUnit, factory, defaultURI, version, true);
if (app != null){