// We need to wait to preload until after we get back a fully configured/instantiated
// BrokerFactory. This is because it is possible that someone has extended OpenJPA
// functions and they need to be allowed time to configure themselves before we go off and
// start instanting configurable objects (ie:openjpa.MetaDataRepository). Don't catch
// any exceptions here because we want to fail-fast.
OpenJPAConfiguration conf = factory.getConfiguration();
Options o = Configurations.parseProperties(Configurations.getProperties(conf.getMetaDataRepository()));
if (MetaDataRepository.needsPreload(o) == true) {
MetaDataRepository mdr = conf.getMetaDataRepositoryInstance();
mdr.setValidate(MetaDataRepository.VALIDATE_RUNTIME, true);
mdr.setResolve(MetaDataRepository.MODE_MAPPING_INIT, true);
// Load persistent classes and hook in subclasser
((AbstractBrokerFactory) factory).loadPersistentTypes((ClassLoader) AccessController