if (validatorFactory != null) {
emfBuilder.withValidatorFactory(validatorFactory);
}
// get the EntityManagerFactory from the second phase of the persistence unit bootstrap
entityManagerFactory = emfBuilder.build();
} else {
JPA_LOGGER.startingService("Persistence Unit", pu.getScopedPersistenceUnitName());
// start the persistence unit in one pass (1 of 1)
pu.setTempClassLoaderFactory(new TempClassLoaderFactoryImpl(classLoader));
pu.setJtaDataSource(jtaDataSource.getOptionalValue());